2026-05-06 17:21:40 +05:30
|
|
|
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.
|
|
|
|
|
*/
|
|
|
|
|
|
2026-07-06 15:12:40 +05:30
|
|
|
export function newChatUrl(workspaceId: number): string {
|
|
|
|
|
return `/dashboard/${workspaceId}/new-chat`;
|
2026-05-06 17:21:40 +05:30
|
|
|
}
|
|
|
|
|
|
2026-07-06 15:12:40 +05:30
|
|
|
export function connectorsCallbackUrl(workspaceId: number): string {
|
|
|
|
|
return `/dashboard/${workspaceId}/connectors/callback`;
|
2026-05-06 17:21:40 +05:30
|
|
|
}
|
|
|
|
|
|
2026-07-06 15:12:40 +05:30
|
|
|
export async function gotoNewChat(page: Page, workspaceId: number): Promise<void> {
|
|
|
|
|
const target = newChatUrl(workspaceId);
|
2026-05-06 17:21:40 +05:30
|
|
|
await page.goto(target, { waitUntil: "domcontentloaded" });
|
|
|
|
|
await expect(page).toHaveURL((url) => url.pathname === target);
|
|
|
|
|
}
|