mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
test fixes
This commit is contained in:
@@ -462,9 +462,6 @@ class App(Generic[ReturnType], DOMNode):
|
|||||||
SUSPENDED_SCREEN_CLASS: ClassVar[str] = ""
|
SUSPENDED_SCREEN_CLASS: ClassVar[str] = ""
|
||||||
"""Class to apply to suspended screens, or empty string for no class."""
|
"""Class to apply to suspended screens, or empty string for no class."""
|
||||||
|
|
||||||
HOVER_EFFECTS_SCROLL_PAUSE: ClassVar[float] = 0.02
|
|
||||||
"""Seconds to pause hover effects for when scrolling."""
|
|
||||||
|
|
||||||
_PSEUDO_CLASSES: ClassVar[dict[str, Callable[[App[Any]], bool]]] = {
|
_PSEUDO_CLASSES: ClassVar[dict[str, Callable[[App[Any]], bool]]] = {
|
||||||
"focus": lambda app: app.app_focus,
|
"focus": lambda app: app.app_focus,
|
||||||
"blur": lambda app: not app.app_focus,
|
"blur": lambda app: not app.app_focus,
|
||||||
@@ -2824,8 +2821,6 @@ class App(Generic[ReturnType], DOMNode):
|
|||||||
Args:
|
Args:
|
||||||
widget: Widget under mouse, or None for no widgets.
|
widget: Widget under mouse, or None for no widgets.
|
||||||
"""
|
"""
|
||||||
if widget is not None and widget.is_scrolling:
|
|
||||||
return
|
|
||||||
if widget is None:
|
if widget is None:
|
||||||
if self.mouse_over is not None:
|
if self.mouse_over is not None:
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -72,10 +72,10 @@ async def test_lists_of_selectors_in_nested_css() -> None:
|
|||||||
class DeclarationAfterNestedApp(App[None]):
|
class DeclarationAfterNestedApp(App[None]):
|
||||||
CSS = """
|
CSS = """
|
||||||
Screen {
|
Screen {
|
||||||
|
background: green;
|
||||||
Label {
|
Label {
|
||||||
background: red;
|
background: red;
|
||||||
}
|
}
|
||||||
background: green;
|
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ from textual.widgets import Checkbox, Footer
|
|||||||
|
|
||||||
class ScrollOffByOne(App):
|
class ScrollOffByOne(App):
|
||||||
AUTO_FOCUS = None
|
AUTO_FOCUS = None
|
||||||
HOVER_EFFECTS_SCROLL_PAUSE = 0.0
|
|
||||||
|
|
||||||
def compose(self) -> ComposeResult:
|
def compose(self) -> ComposeResult:
|
||||||
for number in range(1, 100):
|
for number in range(1, 100):
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ class ScrollOffByOne(App):
|
|||||||
"""Scroll to item 50."""
|
"""Scroll to item 50."""
|
||||||
|
|
||||||
AUTO_FOCUS = None
|
AUTO_FOCUS = None
|
||||||
HOVER_EFFECTS_SCROLL_PAUSE = 0
|
|
||||||
|
|
||||||
def compose(self) -> ComposeResult:
|
def compose(self) -> ComposeResult:
|
||||||
for number in range(1, 100):
|
for number in range(1, 100):
|
||||||
|
|||||||
@@ -39,10 +39,11 @@ async def test_lazy_reveal():
|
|||||||
async with app.run_test() as pilot:
|
async with app.run_test() as pilot:
|
||||||
# No #foo on initial mount
|
# No #foo on initial mount
|
||||||
|
|
||||||
# Only first child should be visible initially
|
# Only first child should be available initially
|
||||||
assert app.query_one("#foo").display
|
assert app.query_one("#foo").display
|
||||||
assert not app.query_one("#bar").display
|
# Next two aren't mounted yet
|
||||||
assert not app.query_one("#baz").display
|
assert not app.query("#bar")
|
||||||
|
assert not app.query("#baz")
|
||||||
|
|
||||||
# All children should be visible after a pause
|
# All children should be visible after a pause
|
||||||
await pilot.pause()
|
await pilot.pause()
|
||||||
|
|||||||
Reference in New Issue
Block a user