From c2f4c2a684243d39b7be917892408c60ea7e998a Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Sun, 26 Jan 2025 18:54:00 +0000 Subject: [PATCH] overflow test --- tests/snapshot_tests/test_snapshots.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/snapshot_tests/test_snapshots.py b/tests/snapshot_tests/test_snapshots.py index c54c2b9883..0c0cb70f2e 100644 --- a/tests/snapshot_tests/test_snapshots.py +++ b/tests/snapshot_tests/test_snapshots.py @@ -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 @@ -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())