|
| 1 | +import { describe, it, expect } from 'vitest'; |
| 2 | +import { Notification } from './Notification'; |
| 3 | + |
| 4 | +describe('Notification Model - Accessibility & Screen Reader Aria Compliance', () => { |
| 5 | + it('provides accessible username field metadata', () => { |
| 6 | + const usernamePath = Notification.schema.path('username'); |
| 7 | + |
| 8 | + expect(usernamePath).toBeDefined(); |
| 9 | + expect(usernamePath.instance).toBe('String'); |
| 10 | + }); |
| 11 | + |
| 12 | + it('provides accessible email field metadata', () => { |
| 13 | + const emailPath = Notification.schema.path('email'); |
| 14 | + |
| 15 | + expect(emailPath).toBeDefined(); |
| 16 | + expect(emailPath.instance).toBe('String'); |
| 17 | + }); |
| 18 | + |
| 19 | + it('ensures notification frequency options are clearly enumerable for assistive technologies', () => { |
| 20 | + const frequencyPath = Notification.schema.path('frequency'); |
| 21 | + |
| 22 | + expect(frequencyPath).toBeDefined(); |
| 23 | + expect((frequencyPath as { enumValues: string[] }).enumValues).toEqual([ |
| 24 | + 'realtime', |
| 25 | + 'daily', |
| 26 | + 'weekly', |
| 27 | + ]); |
| 28 | + }); |
| 29 | + |
| 30 | + it('ensures boolean notification preferences expose explicit state values', () => { |
| 31 | + expect(Notification.schema.path('notifyOnCommit')).toBeDefined(); |
| 32 | + expect(Notification.schema.path('notifyOnStreak')).toBeDefined(); |
| 33 | + expect(Notification.schema.path('notifyOnMilestone')).toBeDefined(); |
| 34 | + }); |
| 35 | + |
| 36 | + it('ensures active status field exists for accessibility state tracking', () => { |
| 37 | + const activePath = Notification.schema.path('isActive'); |
| 38 | + |
| 39 | + expect(activePath).toBeDefined(); |
| 40 | + expect(activePath.instance).toBe('Boolean'); |
| 41 | + }); |
| 42 | +}); |
0 commit comments