mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Improve tests.
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -0,0 +1,29 @@
|
||||
from textual.app import App
|
||||
from textual.containers import Grid
|
||||
from textual.widgets import Label
|
||||
|
||||
|
||||
class ProgrammaticScrollbarGutterChange(App[None]):
|
||||
CSS = """
|
||||
Grid { grid-size: 2 2; scrollbar-size: 5 5; }
|
||||
Label { width: 100%; height: 100%; background: red; }
|
||||
"""
|
||||
|
||||
def compose(self):
|
||||
yield Grid(
|
||||
Label("one"),
|
||||
Label("two"),
|
||||
Label("three"),
|
||||
Label("four"),
|
||||
)
|
||||
|
||||
def on_key(self, event):
|
||||
if event.key == "s":
|
||||
self.query_one(Grid).styles.scrollbar_gutter = "stable"
|
||||
|
||||
|
||||
app = ProgrammaticScrollbarGutterChange()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app().run()
|
||||
@@ -179,6 +179,16 @@ def test_nested_auto_heights(snap_compare):
|
||||
assert snap_compare("snapshot_apps/nested_auto_heights.py", press=["1", "2", "_"])
|
||||
|
||||
|
||||
def test_programmatic_scrollbar_gutter_change(snap_compare):
|
||||
"""Regression test for #1607 https://github.com/Textualize/textual/issues/1607
|
||||
|
||||
See also tests/css/test_programmatic_style_changes.py for other related regression tests.
|
||||
"""
|
||||
assert snap_compare(
|
||||
"snapshot_apps/programmatic_scrollbar_gutter_change.py", press=["s"]
|
||||
)
|
||||
|
||||
|
||||
# --- Other ---
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user