Skip to content

Commit

Permalink
tests fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lemonowl committed Oct 17, 2024
1 parent 93e7a46 commit 04c8a82
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@

it 'Cross-reference to bookmarks' do
docx = builder.build_and_parse('js/docx/paragraph/cross_reference/add_bookmark_cross_ref.js')
expect(docx.elements[1].nonempty_runs[1].text).to eq('Paragraph')
# TODO: 'check after release'
if builder.semver >= Semantic::Version.new('8.2.0')
expect(docx.elements[1].nonempty_runs[1].text).to eq('Paragraph')
else
expect(docx.elements[1].nonempty_runs[1].text).to eq('Paragraph ')
end
expect(docx.elements[1].runs[2].instruction_text.value).to eq(' REF Bookmark \\h')
# TODO: bug 'https://bugzilla.onlyoffice.com/show_bug.cgi?id=58898'
# expect(docx.elements[2].nonempty_runs[1].text).to eq('1')
Expand Down
10 changes: 8 additions & 2 deletions spec/docx/smoke/api_range_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@
describe 'ApiRange section tests' do
it 'ApiRange | ToJSON method' do
docx = builder.build_and_parse('js/docx/smoke/api_range/to_json.js')
expect(docx.elements[1].nonempty_runs.first.text).to eq('ONLYOFFICE')
json = JSON.parse(docx.elements[0].nonempty_runs.first.text)
expect(json['type']).to eq('document')
expect(json['content'][0]['content'][1]['content'][0]).to eq('ONLYOFFICE')
# TODO: 'check after release'
if builder.semver >= Semantic::Version.new('8.2.0')
expect(docx.elements[1].nonempty_runs.first.text).to eq('ONLYOFFICE')
expect(json['content'][0]['content'][1]['content'][0]).to eq('ONLYOFFICE')
else
expect(docx.elements[1].nonempty_runs.first.text).to eq('ONLYOFFICE ')
expect(json['content'][0]['content'][0]['content'][0]).to eq('ONLYOFFICE ')
end
end

describe 'ApiRange | GetRange method' do
Expand Down

0 comments on commit 04c8a82

Please sign in to comment.