deer-flow/frontend/tests/e2e-real-backend/auth-disabled-contract.spec.ts
Ryker_Feng 9fda432ba1
feat(artifacts): preview CSV and TSV files as bounded tables (#5284)
* feat(artifacts): preview CSV and TSV files as bounded tables

* chore: keep preview screenshots out of the PR file diff

* fix(artifacts): detect record newlines outside quoted fields

* test(auth): include project permissions in me contract expectations
2026-09-08 19:11:11 +08:00

37 lines
1.1 KiB
TypeScript

import { expect, test } from "@playwright/test";
import { AUTH_DISABLED_USER } from "../../src/core/auth/auth-disabled-user";
const APP =
process.env.E2E_APP_URL ??
`http://localhost:${process.env.E2E_FRONTEND_PORT ?? "3000"}`;
// /me also returns the caller's effective route permissions (RFC #4063
// Phase 4). Auth-disabled mode grants the full registered set, in the order
// of backend _ALL_PERMISSIONS (backend/app/gateway/authz.py).
const AUTH_DISABLED_PERMISSIONS = [
"threads:read",
"threads:write",
"threads:delete",
"runs:create",
"runs:read",
"runs:cancel",
"projects:read",
"projects:write",
"projects:delete",
];
test.describe("auth-disabled contract (real backend)", () => {
test("gateway /auth/me returns the frontend synthetic user without a cookie", async ({
context,
}) => {
const resp = await context.request.get(`${APP}/api/v1/auth/me`);
expect(resp.status(), await resp.text()).toBe(200);
await expect(resp.json()).resolves.toEqual({
...AUTH_DISABLED_USER,
permissions: AUTH_DISABLED_PERMISSIONS,
});
});
});