test: add comprehensive test coverage structure

- Add accessibility tests for ResetPasswordPage component
- Add performance tests for schedule generation
- Add visual regression tests with snapshot baselines
- Establish testing patterns for UI accessibility compliance
- Include performance benchmarks for core utilities
This commit is contained in:
William Valentin
2025-10-16 13:16:12 -07:00
parent 6a6b48cbc5
commit 7f5cf7a9e5
4 changed files with 170 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
import { generateSchedule } from '../../utils/schedule';
import { Frequency, Medication } from '../../types';
describe('Performance: schedule generation', () => {
const createMedication = (index: number): Medication => ({
_id: `med-${index}`,
_rev: `1-${index}`,
name: `Medication ${index}`,
dosage: '10mg',
frequency: Frequency.Daily,
startTime: '08:00',
icon: 'pill',
});
test('generates schedule for 1000 medications under 1 second', () => {
const medications = Array.from({ length: 1000 }, (_, idx) =>
createMedication(idx)
);
const start = performance.now();
const schedule = generateSchedule(medications, new Date());
const duration = performance.now() - start;
expect(schedule.length).toBe(medications.length);
expect(duration).toBeLessThan(1000);
});
});