punimtag/e2e/tests/api.auth.spec.ts
ilia 47b15049bc
All checks were successful
CI / skip-ci-check (pull_request) Successful in 4s
CI / docker-ci (pull_request) Successful in 6s
CI / secret-scan (pull_request) Successful in 13s
CI / e2e (pull_request) Successful in 2m14s
CI / viewer-unit (pull_request) Successful in 2m38s
Expand e2e auth coverage, Vitest CI, and shared URL defaults
Wire viewer-frontend Vitest into Gitea Actions, centralize DEV base URLs
in env-defaults.json, expand playkit API catalog specs, and land auth/mail
flows plus verify-email public-host redirect and idle-logout e2e hooks.
2026-07-14 18:49:42 -04:00

19 lines
704 B
TypeScript

import { test, expect } from '../fixtures';
test.describe('api auth @smoke', () => {
test('protected /api/v1/auth/me returns 401 without token', async ({ api, timings }) => {
const res = await timings.measure('api_me_unauth', () =>
api.get('/api/v1/auth/me', { expectedStatus: 401 }),
);
expect(res.status).toBe(401);
expect(res.data).toMatchObject({ detail: expect.stringMatching(/not authenticated/i) });
});
test('protected /api/v1/photos returns 401 without token', async ({ api, timings }) => {
const res = await timings.measure('api_photos_unauth', () =>
api.get('/api/v1/photos', { expectedStatus: 401 }),
);
expect(res.status).toBe(401);
});
});