Files
headroom/frontend/tests/component/app-layout.test.ts
Santhosh Janardhanan 493cb78173 feat(layout): finalize p01 and p02 changes
Complete UI foundation and app layout implementation, stabilize container health checks, and archive both OpenSpec changes after verification.
2026-02-18 16:12:11 -05:00

26 lines
829 B
TypeScript

import { describe, expect, it } from 'vitest';
import { readFileSync } from 'node:fs';
import { resolve } from 'node:path';
import AppLayout, { getContentOffsetClass } from '../../src/lib/components/layout/AppLayout.svelte';
describe('AppLayout component', () => {
it('exports a component module', () => {
expect(AppLayout).toBeDefined();
});
it('renders children via slot', () => {
const source = readFileSync(
resolve(process.cwd(), 'src/lib/components/layout/AppLayout.svelte'),
'utf-8'
);
expect(source).toContain('<slot />');
});
it('maps sidebar states to layout offsets', () => {
expect(getContentOffsetClass('expanded')).toBe('md:ml-60');
expect(getContentOffsetClass('collapsed')).toBe('md:ml-16');
expect(getContentOffsetClass('hidden')).toBe('md:ml-0');
});
});