Fix tests.

This commit is contained in:
Rodrigo Girão Serrão
2023-05-16 11:39:38 +01:00
parent b592ac077a
commit a6ee867ee3
2 changed files with 5 additions and 3 deletions

View File

@@ -666,6 +666,8 @@ class Screen(Generic[ScreenResultType], Widget):
"""Screen has resumed."""
self.stack_updates += 1
size = self.app.size
self._refresh_layout(size, full=True)
self.refresh()
if self.AUTO_FOCUS is not None and self.focused is None:
try:
focus_candidates = self.query(self.AUTO_FOCUS)
@@ -676,8 +678,6 @@ class Screen(Generic[ScreenResultType], Widget):
if widget.focusable:
self.set_focus(widget)
break
self._refresh_layout(size, full=True)
self.refresh()
def _on_screen_suspend(self) -> None:
"""Screen has suspended."""

View File

@@ -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_tables.py")
def test_option_list_build(snap_compare):
assert snap_compare(SNAPSHOT_APPS_DIR / "option_list.py")
def test_progress_bar_indeterminate(snap_compare):
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
assert snap_compare(
SNAPSHOT_APPS_DIR / "modal_screen_bindings.py",
press=["enter", "tab", "h", "!", "left", "i", "tab"],
press=["enter", "h", "!", "left", "i", "tab"],
)