Wait for a space entry redirect before opening search in the people specs

This commit is contained in:
Coracle-Bot 2026-09-10 07:00:57 +00:00 committed by hodlbod
parent 214ef0f50c
commit d6d77f629c

View file

@ -53,6 +53,10 @@ const sidebar = (page: Page) => page.locator("aside")
// content in it. // content in it.
const dialog = (page: Page) => page.locator(".dialog").last() const dialog = (page: Page) => page.locator(".dialog").last()
// A space path redirects to the space's entry room as the page mounts, and modal.ts closes every
// open modal on navigation, so a dialog opened before the redirect lands is thrown away with it.
const enteredSpace = (page: Page) => expect(page).toHaveURL(new RegExp("/spaces/[^/]+/."))
// Search is a dialog the nav opens rather than a page of its own. // Search is a dialog the nav opens rather than a page of its own.
const openSearch = (page: Page) => page.locator('.primary-nav button[data-tip="Search"]').click() const openSearch = (page: Page) => page.locator('.primary-nav button[data-tip="Search"]').click()
@ -121,6 +125,7 @@ test("US-074 find a person", async ({seed, as}) => {
const term = searchTerm(page) const term = searchTerm(page)
const cards = searchResults(page) const cards = searchResults(page)
await enteredSpace(page)
await openSearch(page) await openSearch(page)
await term.fill("Searcher") await term.fill("Searcher")
@ -297,6 +302,7 @@ test("US-077 see web-of-trust standing build up", async ({seed, as}) => {
const ring = async () => const ring = async () =>
Number(await bobCard.locator("circle.wot-highlight").getAttribute("stroke-dashoffset")) Number(await bobCard.locator("circle.wot-highlight").getAttribute("stroke-dashoffset"))
await enteredSpace(page)
await openSearch(page) await openSearch(page)
await term.fill("Barnacle") await term.fill("Barnacle")