Skip to content

Commit c624d50

Browse files
committed
Wait for initial conversation before palette navigation
Signed-off-by: Codex <[email protected]>
1 parent ad13185 commit c624d50

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

‎tests/browser/navigation.mjs‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,41 @@ export async function openPage(page, name) {
1212
await expect(
1313
page.getByRole("button", { name: "Switch to Primary", exact: true }),
1414
).toBeVisible();
15+
const target = await page.evaluate(
16+
() => history.state?.buzzNavigationV1?.entry?.target,
17+
);
18+
if (
19+
target?.kind === "conversation" ||
20+
(target?.kind === "page" &&
21+
target.pluginId === "buzz.channels" &&
22+
target.pageId === "channels" &&
23+
target.scope !== null)
24+
) {
25+
// The launch page resolves into the first conversation after the rail mounts.
26+
// Opening search before that route presents can replace its choices mid-click.
27+
const main = page.getByRole("main");
28+
const conversation = main.getByRole("article", {
29+
name: "Conversation",
30+
exact: true,
31+
});
32+
const failure = main
33+
.getByRole("alert")
34+
.filter({ hasText: "This destination couldn’t open" });
35+
await expect
36+
.poll(
37+
async () => {
38+
const kind = await page.evaluate(
39+
() => history.state?.buzzNavigationV1?.entry?.target?.kind,
40+
);
41+
return (
42+
(kind === "conversation" && (await conversation.isVisible())) ||
43+
(await failure.isVisible())
44+
);
45+
},
46+
{ message: "initial Messages route presents" },
47+
)
48+
.toBe(true);
49+
}
1550
const choices = await pageChoices(page);
1651
const dialog = page.getByRole("dialog", { name: "Search Buzz", exact: true });
1752
const choice = choices.getByRole("option", { name, exact: true });

0 commit comments

Comments
 (0)