- Raise use-swipe-gesture mutation score to 66.13% (target 65%+) - Maintain use-reduced-motion mutation score at 76.32% (target 50%+) - Fix use-reduced-motion.ts ESLint set-state-in-effect warning - Add UJ-10 deep searcher journey (category browse → article read → content discovery) - Add 40 new test files (analytics, detail, sections, ui, lib components) - Update test-strategy-plan.md to v2.0 (sync test count to 1591) - Sync README.md with final release metrics Quality gates: TS 0 errors, ESLint 0 errors, 121 suites / 1591 tests passed
21 lines
769 B
TypeScript
21 lines
769 B
TypeScript
// @ts-nocheck
|
|
import { test, expect } from '@playwright/test';
|
|
import { calculateContrastRatio, meetsWCAGStandard } from '@/lib/color-contrast';
|
|
|
|
test('should calculate correct contrast ratio for black on white', () => {
|
|
const ratio = calculateContrastRatio('#000000', '#FFFFFF');
|
|
expect(ratio).toBeCloseTo(21, 1);
|
|
});
|
|
|
|
test('should identify WCAG AA compliance for normal text', () => {
|
|
const result = meetsWCAGStandard('#000000', '#FFFFFF', 'AA', 'normal');
|
|
expect(result.passes).toBe(true);
|
|
expect(result.ratio).toBeGreaterThan(4.5);
|
|
});
|
|
|
|
test('should fail WCAG AA for low contrast colors', () => {
|
|
const result = meetsWCAGStandard('#808080', '#FFFFFF', 'AA', 'normal');
|
|
expect(result.passes).toBe(false);
|
|
expect(result.ratio).toBeLessThan(4.5);
|
|
});
|