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:
26
tests/performance/schedule.performance.test.ts
Normal file
26
tests/performance/schedule.performance.test.ts
Normal 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);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user