Skip to content

Commit

Permalink
ref: ApiRGBColorToJSON
Browse files Browse the repository at this point in the history
  • Loading branch information
Yar04ek committed Dec 1, 2023
1 parent 5b36d80 commit a95d75a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions spec/docx/smoke/api_rgb_color_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@

it 'ApiRGBColor | ToJSON method' do
docx = builder.build_and_parse('js/docx/smoke/api_rgb_color/to_json.js')
first_paragraph_json = JSON.parse(docx.elements[0].nonempty_runs.first.text)
expect(first_paragraph_json['color']['rgba']['red']).to eq(255)
expect(first_paragraph_json['color']['rgba']['green']).to eq(111)
expect(first_paragraph_json['color']['rgba']['blue']).to eq(61)
rgba = JSON.parse(docx.elements[1].nonempty_runs.first.text)
lst = rgba['graphic']['spPr']['fill']['fill']['gsLst'][1]['color']['color']['rgba']
expect(lst['red']).to eq(255)
expect(lst['green']).to eq(111)
expect(lst['blue']).to eq(61)
end
end

0 comments on commit a95d75a

Please sign in to comment.