perfect-postcode/frontend/src/index-html.test.ts
2026-07-03 18:01:10 +01:00

17 lines
686 B
TypeScript

import { readFileSync } from 'fs';
import { resolve } from 'path';
import { describe, it, expect } from 'vitest';
describe('index.html viewport', () => {
// vitest runs with cwd at the frontend package root.
const html = readFileSync(resolve(process.cwd(), 'src/index.html'), 'utf-8');
it('allows pinch-zoom (WCAG 1.4.4)', () => {
const m = html.match(/<meta name="viewport" content="([^"]*)"/);
expect(m).not.toBeNull();
const content = m![1];
expect(content).not.toMatch(/maximum-scale/);
expect(content).not.toMatch(/user-scalable\s*=\s*no/);
expect(content).toContain('width=device-width');
expect(content).toContain('initial-scale=1');
});
});