Skip to content

Commit b76990e

Browse files
committed
Attempt at creating a test for new page
1 parent 88aea45 commit b76990e

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/test_core.py renamed to tests/test_router.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,3 +277,20 @@ def sample():
277277

278278
_link = await display.page.wait_for_selector("#root")
279279
assert "/a" in await _link.get_attribute("href")
280+
281+
282+
async def test_ctrl_click(display: DisplayFixture, browser):
283+
@component
284+
def sample():
285+
return browser_router(
286+
route("/", link({"to": "/a", "id": "root"}, "Root")),
287+
route("/a", link({"to": "/a", "id": "a"}, "a")),
288+
)
289+
290+
await display.show(sample)
291+
292+
_link = await display.page.wait_for_selector("#root")
293+
await _link.click(delay=CLICK_DELAY, modifiers=["Control"])
294+
browser_context = browser.contexts[0]
295+
new_page = await browser_context.wait_for_event("page")
296+
await new_page.wait_for_selector("#a")

0 commit comments

Comments
 (0)