36 lines
1.3 KiB
TypeScript
36 lines
1.3 KiB
TypeScript
import { describe, it, expect } from 'vitest';
|
|
import { headerHtml, splashHtml, splashJs } from '../src/server/board/chrome.js';
|
|
|
|
describe('headerHtml', () => {
|
|
it('renders logo, project cell with chevron, nav and new-task button', () => {
|
|
const h = headerHtml('my-project');
|
|
expect(h).toContain('/logo.svg');
|
|
expect(h).toContain('my-project');
|
|
expect(h).toContain('b2-proj'); // project cell (visual only, dropdown comes with v3)
|
|
expect(h).toContain('▾');
|
|
expect(h).toContain('+ New task');
|
|
expect(h).toContain('id="newTaskBtn"');
|
|
// SSE status mount compatible with the ported v1 connection JS
|
|
expect(h).toContain('id="sseStatus"');
|
|
expect(h).toContain('id="sseLabel"');
|
|
});
|
|
it('escapes the project name', () => {
|
|
expect(headerHtml('<b>x</b>')).not.toContain('<b>x</b>');
|
|
});
|
|
});
|
|
|
|
describe('splash', () => {
|
|
it('renders overlay with logo and wordmark', () => {
|
|
const s = splashHtml();
|
|
expect(s).toContain('id="b2-splash"');
|
|
expect(s).toContain('/logo.svg');
|
|
expect(s).toContain('agenthub');
|
|
});
|
|
it('fade-out script has a hard timeout and never blocks', () => {
|
|
const js = splashJs();
|
|
expect(js).toContain('b2-splash');
|
|
expect(js).toContain('1500'); // hard cap in ms
|
|
expect(js).toContain('__b2SplashDone');
|
|
});
|
|
});
|