test(e2e): fix auth specs for character routes

This commit is contained in:
2026-07-20 15:38:51 +08:00
parent 7967486af7
commit bc6373f4c0
7 changed files with 62 additions and 5 deletions
+3 -1
View File
@@ -11,7 +11,7 @@ export const splashStartChatButtonName = "Start Chatting";
export const defaultCharacterSlug = "elio";
export const defaultCharacterSplashPath = `/characters/${defaultCharacterSlug}/splash`;
export const defaultCharacterChatPath = `/characters/${defaultCharacterSlug}/chat`;
export const defaultCharacterSidebarPath = `/characters/${defaultCharacterSlug}/sidebar`;
export const defaultCharacterSidebarPath = `/sidebar?returnTo=%2Fcharacters%2F${defaultCharacterSlug}%2Fchat`;
export const defaultCharacterChatUrl = new RegExp(
`/characters/${defaultCharacterSlug}/chat(?:\\?.*)?$`,
);
@@ -34,6 +34,8 @@ export async function seedEmailSession(page: Page) {
await page.goto(defaultCharacterSplashPath);
await setEmailSessionStorage(page);
await page.reload();
// Let the root auth provider hydrate the seeded session before navigation.
await page.waitForTimeout(750);
}
export async function switchToEmailSignIn(page: Page) {