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');
  });
});
