Skip to content

Commit

Permalink
Merge branch 'fork/api_table_row_js' of https://github.com/ONLYOFFICE…
Browse files Browse the repository at this point in the history
…/doc-builder-testing into fork/api_table_row_js
  • Loading branch information
Yar04ek committed Nov 28, 2023
2 parents 77b0037 + ad1d4e0 commit 4a51180
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
18 changes: 9 additions & 9 deletions js/docx/smoke/api_table_row_pr/to_json.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
builder.CreateFile("docx");
let oDocument = Api.GetDocument();
let oParagraph = oDocument.GetElement(0);
let oTableStyle = oDocument.CreateStyle("CustomTableStyle", "table");
oTableStyle.SetName("My Custom Table Style");
let oTableRowPr = oTableStyle.GetTableRowPr();
oTableRowPr.SetHeight("atLeast", 720);
let jsonTableStyle = oTableStyle.ToJSON();
GlobalVariable["JSON_TableStyle"] = jsonTableStyle;
oParagraph.AddText(jsonTableStyle);
let oDocument = Api.GetDocument();
let oParagraph = oDocument.GetElement(0);
let oTableStyle = oDocument.CreateStyle("CustomTableStyle", "table");
oTableStyle.SetName("My Custom Table Style");
let oTableRowPr = oTableStyle.GetTableRowPr();
oTableRowPr.SetHeight("atLeast", 720);
let jsonTableStyle = oTableStyle.ToJSON();
GlobalVariable["JSON_TableStyle"] = jsonTableStyle;
oParagraph.AddText(jsonTableStyle);
builder.CloseFile();

//////////////
Expand Down
9 changes: 4 additions & 5 deletions spec/docx/smoke/api_rgb_color_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@
it 'ApiRGBColor | GetClassType method' do
docx = builder.build_and_parse('js/docx/smoke/api_rgb_color/get_class_type.js')
expect(docx.elements[1].nonempty_runs.first.text).to eq('Class Type = rgbColor')

end


it 'ApiRGBColor | ToJSON method' do
docx = builder.build_and_parse('js/docx/smoke/api_rgb_color/to_json.js')
first_paragraph_text = '{"rgba":{"red":0,"green":0,"blue":0,"alpha":255},"color":{"rgba":{"red":255,"green":111,"blue":61,"alpha":255},"type":"srgb"},"type":"uniColor"}'
expected_text = '{"rgba":{"red":0,"green":0,"blue":0,"alpha":255},"color":{"rgba":{"red":255,"green":111,"blue":61,"alpha":255},"type":"srgb"},"type":"uniColor"}'
expected_json = JSON.parse(expected_text)
third_paragraph_text = docx.elements[2].nonempty_runs.first.text
expect(third_paragraph_text).to include(first_paragraph_text)
third_paragraph_json = JSON.parse(third_paragraph_text)
expect(third_paragraph_json).to include(expected_json)
end

end

0 comments on commit 4a51180

Please sign in to comment.