mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-13 09:42:40 +02:00
test(web): add shared Playwright E2E helpers and search-space fixture
This commit is contained in:
parent
a2976ee0b6
commit
ae0caad292
10 changed files with 673 additions and 0 deletions
21
surfsense_web/tests/helpers/ui/dashboard.ts
Normal file
21
surfsense_web/tests/helpers/ui/dashboard.ts
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import type { Page } from "@playwright/test";
|
||||
import { expect } from "@playwright/test";
|
||||
|
||||
/**
|
||||
* Navigation helpers for dashboard routes. Centralized so that future
|
||||
* route changes only require an update in one place.
|
||||
*/
|
||||
|
||||
export function newChatUrl(searchSpaceId: number): string {
|
||||
return `/dashboard/${searchSpaceId}/new-chat`;
|
||||
}
|
||||
|
||||
export function connectorsCallbackUrl(searchSpaceId: number): string {
|
||||
return `/dashboard/${searchSpaceId}/connectors/callback`;
|
||||
}
|
||||
|
||||
export async function gotoNewChat(page: Page, searchSpaceId: number): Promise<void> {
|
||||
const target = newChatUrl(searchSpaceId);
|
||||
await page.goto(target, { waitUntil: "domcontentloaded" });
|
||||
await expect(page).toHaveURL((url) => url.pathname === target);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue