Skip to content
File

Blob: tests/e2e/specs/28-oidc-first-login.spec.ts

typescript17 lines
1import { test, expect, loginAsFreshTesseraUser } from "../fixtures/bland-test";
2 
3test.describe("OIDC first-time login", () => {
4 test("a fresh tessera user lands on a default workspace and can list workspaces", async ({ page }) => {
5 const sub = `e2e-fresh-${Date.now()}`;
6 const email = `${sub}@bland.test`;
7 const { accessToken } = await loginAsFreshTesseraUser(page, { sub, email, name: "Fresh Pilot" }, "/");
8 
9 const res = await page.request.get("/api/v1/workspaces", {
10 headers: { Authorization: `Bearer ${accessToken}` },
11 });
12 expect(res.ok()).toBe(true);
13 const body = (await res.json()) as { workspaces: Array<{ id: string; slug: string }> };
14 expect(body.workspaces.length).toBeGreaterThan(0);
15 });
16});