mirror of
https://github.com/garrytan/gbrain.git
synced 2026-07-28 06:23:01 +00:00
14 lines
553 B
TypeScript
14 lines
553 B
TypeScript
import { describe, expect, test } from 'bun:test';
|
|
import { readFileSync } from 'fs';
|
|
|
|
describe('admin dashboard SSE credentials', () => {
|
|
const dashboardSrc = readFileSync('admin/src/pages/Dashboard.tsx', 'utf8');
|
|
|
|
test('Live Activity EventSource sends admin session cookies through reverse proxies', () => {
|
|
expect(dashboardSrc).toMatch(
|
|
/new EventSource\(\s*['"]\/admin\/events['"]\s*,\s*\{\s*withCredentials:\s*true\s*\}\s*\)/,
|
|
);
|
|
expect(dashboardSrc).not.toMatch(/new EventSource\(\s*['"]\/admin\/events['"]\s*\)/);
|
|
});
|
|
});
|