Skip to content

Commit

Permalink
rename util
Browse files Browse the repository at this point in the history
  • Loading branch information
Archmonger committed Nov 19, 2024
1 parent b284987 commit 1ee32a7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions tests/test_rendering.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from reactpy_router import browser_router, route

from .utils import page_stable
from .utils import page_load_complete


@pytest.mark.anyio
Expand Down Expand Up @@ -37,21 +37,21 @@ def not_found():
)

await display.show(root)
await page_stable(display.page)
await page_load_complete(display.page)

assert root_render_count == 1
assert home_page_render_count == 1
assert not_found_render_count == 0

await display.goto("/xxx")
await page_stable(display.page)
await page_load_complete(display.page)

assert root_render_count == 2
assert home_page_render_count == 1
assert not_found_render_count == 1

await display.goto("/yyy")
await page_stable(display.page)
await page_load_complete(display.page)

assert root_render_count == 3
assert home_page_render_count == 1
Expand Down
2 changes: 1 addition & 1 deletion tests/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from playwright.async_api._generated import Page


async def page_stable(page: Page) -> None:
async def page_load_complete(page: Page) -> None:
"""Only return when network is idle and DOM has loaded"""
await page.wait_for_load_state("networkidle")
await page.wait_for_load_state("domcontentloaded")

0 comments on commit 1ee32a7

Please sign in to comment.