mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Fix tests.
This commit is contained in:
@@ -666,6 +666,8 @@ class Screen(Generic[ScreenResultType], Widget):
|
|||||||
"""Screen has resumed."""
|
"""Screen has resumed."""
|
||||||
self.stack_updates += 1
|
self.stack_updates += 1
|
||||||
size = self.app.size
|
size = self.app.size
|
||||||
|
self._refresh_layout(size, full=True)
|
||||||
|
self.refresh()
|
||||||
if self.AUTO_FOCUS is not None and self.focused is None:
|
if self.AUTO_FOCUS is not None and self.focused is None:
|
||||||
try:
|
try:
|
||||||
focus_candidates = self.query(self.AUTO_FOCUS)
|
focus_candidates = self.query(self.AUTO_FOCUS)
|
||||||
@@ -676,8 +678,6 @@ class Screen(Generic[ScreenResultType], Widget):
|
|||||||
if widget.focusable:
|
if widget.focusable:
|
||||||
self.set_focus(widget)
|
self.set_focus(widget)
|
||||||
break
|
break
|
||||||
self._refresh_layout(size, full=True)
|
|
||||||
self.refresh()
|
|
||||||
|
|
||||||
def _on_screen_suspend(self) -> None:
|
def _on_screen_suspend(self) -> None:
|
||||||
"""Screen has suspended."""
|
"""Screen has suspended."""
|
||||||
|
|||||||
@@ -203,9 +203,11 @@ def test_option_list(snap_compare):
|
|||||||
assert snap_compare(WIDGET_EXAMPLES_DIR / "option_list_options.py")
|
assert snap_compare(WIDGET_EXAMPLES_DIR / "option_list_options.py")
|
||||||
assert snap_compare(WIDGET_EXAMPLES_DIR / "option_list_tables.py")
|
assert snap_compare(WIDGET_EXAMPLES_DIR / "option_list_tables.py")
|
||||||
|
|
||||||
|
|
||||||
def test_option_list_build(snap_compare):
|
def test_option_list_build(snap_compare):
|
||||||
assert snap_compare(SNAPSHOT_APPS_DIR / "option_list.py")
|
assert snap_compare(SNAPSHOT_APPS_DIR / "option_list.py")
|
||||||
|
|
||||||
|
|
||||||
def test_progress_bar_indeterminate(snap_compare):
|
def test_progress_bar_indeterminate(snap_compare):
|
||||||
assert snap_compare(WIDGET_EXAMPLES_DIR / "progress_bar_isolated_.py", press=["f"])
|
assert snap_compare(WIDGET_EXAMPLES_DIR / "progress_bar_isolated_.py", press=["f"])
|
||||||
|
|
||||||
@@ -440,7 +442,7 @@ def test_modal_dialog_bindings_input(snap_compare):
|
|||||||
# Check https://github.com/Textualize/textual/issues/2194
|
# Check https://github.com/Textualize/textual/issues/2194
|
||||||
assert snap_compare(
|
assert snap_compare(
|
||||||
SNAPSHOT_APPS_DIR / "modal_screen_bindings.py",
|
SNAPSHOT_APPS_DIR / "modal_screen_bindings.py",
|
||||||
press=["enter", "tab", "h", "!", "left", "i", "tab"],
|
press=["enter", "h", "!", "left", "i", "tab"],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user