mirror of
https://github.com/rio-labs/rio.git
synced 2026-02-11 08:10:29 -06:00
Merge pull request #294 from ilya-pevzner/on-resize
make components from dialogs with unspecified parent findable in test client
This commit is contained in:
@@ -191,6 +191,10 @@ class BaseClient(abc.ABC):
|
||||
key: Key | None = None,
|
||||
) -> t.Iterator[C]:
|
||||
to_do = [self.root_component]
|
||||
to_do.extend(
|
||||
dialog._root_component
|
||||
for dialog in self.session._fundamental_root_component._owned_dialogs_.values()
|
||||
)
|
||||
seen = set[rio.Component]()
|
||||
|
||||
while to_do:
|
||||
|
||||
@@ -4,7 +4,7 @@ import typing as t
|
||||
import pytest
|
||||
|
||||
import rio
|
||||
from rio.testing import BrowserClient
|
||||
from rio.testing import BrowserClient, DummyClient
|
||||
|
||||
|
||||
class DialogOpener(rio.Component):
|
||||
@@ -89,3 +89,11 @@ async def test_esc_closes_dialog():
|
||||
|
||||
opener = test_client.get_component(DialogOpener)
|
||||
assert opener.dialog_closed
|
||||
|
||||
|
||||
async def test_dialog_content_components_visible():
|
||||
async with DummyClient(
|
||||
lambda: DialogOpener(lambda: rio.Text("foo"))
|
||||
) as test_client:
|
||||
await asyncio.sleep(0.1)
|
||||
assert test_client.get_component(rio.Text)
|
||||
|
||||
Reference in New Issue
Block a user