Skip to content

Commit

Permalink
tests: snapshot of rendering html for multiple styles
Browse files Browse the repository at this point in the history
  • Loading branch information
machow committed Dec 14, 2023
1 parent 4a44250 commit 74facd1
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/__snapshots__/test_utils_render_html.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,24 @@
</tbody>
'''
# ---
# name: test_body_multiple_styles
'''
<tbody class="gt_table_body">
<tr>
<td style="background-color: red; border-left: 1px solid #000000;" class="gt_row gt_right">0.1111</td>
<td class="gt_row gt_left">apricot</td>
</tr>
<tr>
<td class="gt_row gt_right">2.222</td>
<td class="gt_row gt_left">banana</td>
</tr>
<tr>
<td class="gt_row gt_right">33.33</td>
<td class="gt_row gt_left">coconut</td>
</tr>
</tbody>
'''
# ---
# name: test_source_notes_snap
'''
<tfoot class="gt_sourcenotes">
Expand Down
9 changes: 9 additions & 0 deletions tests/test_utils_render_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@ def test_body_multiple_locations(snapshot):
assert_rendered_body(snapshot, new_gt)


def test_body_multiple_styles(snapshot):
new_gt = GT(small_exibble).tab_style(
style=[style.fill(color="red"), style.borders("left")],
locations=loc.body(columns="num", rows=[0]),
)

assert_rendered_body(snapshot, new_gt)


def test_styling_data_01(snapshot):
new_gt = GT(small_exibble).tab_style(
style=style.text(color="red"),
Expand Down

0 comments on commit 74facd1

Please sign in to comment.