Skip to content

Commit

Permalink
overflow test
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Jan 26, 2025
1 parent 4c59821 commit c2f4c2a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tests/snapshot_tests/test_snapshots.py
Original file line number Diff line number Diff line change
Expand Up @@ -3388,8 +3388,8 @@ def compose(self) -> ComposeResult:


def test_overflow(snap_compare):
"""Test overflow. You should see two labels across 4 lines. The first with overflow clip,
the second with overflow ellipsis."""
"""Test overflow. You should see three labels across 4 lines. The first with overflow clip,
the second with overflow ellipsis, and the last with overflow fold."""

TEXT = "FOO " + "FOOBARBAZ" * 100

Expand All @@ -3399,17 +3399,25 @@ class OverflowApp(App):
max-width: 100vw;
}
#label1 {
# Overflow will be cropped
text-overflow: clip;
background: blue 20%;
}
#label2 {
# Like clip, but last character will be an ellipsis
text-overflow: ellipsis;
background: green 20%;
}
#label3 {
# Overflow will fold on to subsequence lines
text-overflow: fold;
background: red 20%;
}
"""

def compose(self) -> ComposeResult:
yield Label(TEXT, id="label1")
yield Label(TEXT, id="label2")
yield Label(TEXT, id="label3")

assert snap_compare(OverflowApp())

0 comments on commit c2f4c2a

Please sign in to comment.