21 lines
1.4 KiB
TypeScript
21 lines
1.4 KiB
TypeScript
import { readFileSync } from 'node:fs';
|
|
import { describe, expect, it } from 'vitest';
|
|
import { CURRENT_ASSESSOR_PROCESSING_VERSION } from '../../src/domain/processing-compatibility';
|
|
|
|
const app = readFileSync(new URL('../../src/app/App.tsx', import.meta.url), 'utf8');
|
|
const layout = readFileSync(new URL('../../src/styles/layout.css', import.meta.url), 'utf8');
|
|
|
|
describe('ASSESSOR version in the brand header', () => {
|
|
it('shows only the centrally maintained processing version below the brand name', () => {
|
|
expect(CURRENT_ASSESSOR_PROCESSING_VERSION).toBe('1.3.0');
|
|
expect(app).toContain("import { CURRENT_ASSESSOR_PROCESSING_VERSION } from '../domain/processing-compatibility';");
|
|
expect(app).toContain('<span className="brand-copy"><h1>ASSESSOR</h1><span className="brand-version">{CURRENT_ASSESSOR_PROCESSING_VERSION}</span></span>');
|
|
expect(app).not.toContain('>Version {CURRENT_ASSESSOR_PROCESSING_VERSION}');
|
|
expect(app).not.toContain('>v{CURRENT_ASSESSOR_PROCESSING_VERSION}');
|
|
expect(layout).toMatch(/\.brand-copy\s*\{[^}]*display:\s*grid;[^}]*gap:\s*var\(--space-1\);/s);
|
|
expect(layout).toMatch(/\.brand-version\s*\{[^}]*font-size:\s*var\(--fs-micro\);[^}]*font-variant-numeric:\s*tabular-nums;/s);
|
|
expect(layout).toMatch(/\.brand\s*\{[^}]*min-height:\s*112px;[^}]*padding:\s*6px 14px 6px 16px;[^}]*margin-top:\s*0;/s);
|
|
expect(layout).not.toMatch(/\.app-shell[^,{]* \.brand\s*\{/s);
|
|
});
|
|
});
|