|
| 1 | +import { Complete } from './Complete'; |
| 2 | +import expectValidFixture from './lib/expectValidFixture'; |
| 3 | +import { getPerceptionModeSchemaDefinition, PerceptionMode } from './PerceptionMode'; |
| 4 | + |
| 5 | +const perceptionModeFixture: Complete<PerceptionMode> = { |
| 6 | + speech: false, |
| 7 | + activationSignal: false, |
| 8 | + alarm: false, |
| 9 | + read: false, |
| 10 | + forceFeedback: false, |
| 11 | + vibration: false, |
| 12 | + led: false, |
| 13 | + breathing: false, |
| 14 | + hapticClick: false, |
| 15 | + audibleClick: false, |
| 16 | + music: false, |
| 17 | + beep: false, |
| 18 | + bing: false, |
| 19 | + pitchedTone: false, |
| 20 | + haptic: false, |
| 21 | + rhythmic: false, |
| 22 | + handwritten: false, |
| 23 | + flash: false, |
| 24 | + morse: false, |
| 25 | + pictograms: false, |
| 26 | + numbers: false, |
| 27 | + animation: false, |
| 28 | + sound: false, |
| 29 | + signLanguage: false, |
| 30 | + tactile: false, |
| 31 | + braille: false, |
| 32 | + tactileGuides: false, |
| 33 | + screen: false, |
| 34 | + chart: false, |
| 35 | + highContrast: false, |
| 36 | + blackAndWhite: false, |
| 37 | + static: false, |
| 38 | + colorCode: false, |
| 39 | + colorGradient: false, |
| 40 | + qrCode: false, |
| 41 | + headphone: true, |
| 42 | + cable: false, |
| 43 | + radio: true, |
| 44 | + byod: true, |
| 45 | + urgent: false, |
| 46 | + info: false, |
| 47 | + warning: false, |
| 48 | + light: true, |
| 49 | + fullBody: true, |
| 50 | + isEasyToUnderstand: true, |
| 51 | + needsHighConcentration: true, |
| 52 | + dedicatedScreenForSubtitles: false, |
| 53 | + subtitles: false, |
| 54 | + audioDescription: false, |
| 55 | + realTimeCaptioning: false, |
| 56 | + plainLanguageOption: true, |
| 57 | + contentWarning: { en: 'Content warning' }, |
| 58 | + name: { en: 'Reaction test' }, |
| 59 | + description: { en: 'Listen to a tone while watching a chart on a screen' }, |
| 60 | + languages: ['en'], |
| 61 | + force: { value: 0.5, unit: 'N' }, |
| 62 | + acceleration: { value: 0.5, unit: 'm/s^2' }, |
| 63 | + soundVolume: { value: 50, unit: 'dB' }, |
| 64 | + brightness: { value: 0.5, unit: 'nits' }, |
| 65 | + ambientNoiseLevel: { value: 30, unit: 'dB' }, |
| 66 | + frequency: { value: 440, unit: 'Hz' }, |
| 67 | + framerate: { value: 48000, unit: 'kHz' }, |
| 68 | + fontSize: { value: 4, unit: 'mm' }, |
| 69 | + foregroundColors: ['red', 'green', 'blue'], |
| 70 | + backgroundColors: ['white'], |
| 71 | + flashingHazard: false, |
| 72 | + techSufficient: [{ |
| 73 | + uris: ['https://example.com/tech/1'], |
| 74 | + }], |
| 75 | + techSupported: [{ |
| 76 | + uris: ['https://example.com/tech/1'], |
| 77 | + }], |
| 78 | + url: { |
| 79 | + en: 'https://example.com/devices/42/output', |
| 80 | + }, |
| 81 | + instructionsUrl: { |
| 82 | + en: 'https://example.com/devices/42/output/howto', |
| 83 | + }, |
| 84 | + apiDocumentationUrl: 'https://example.com/api/documentation', |
| 85 | + necessaryGripHeight: { value: 150, unit: 'cm' }, |
| 86 | + necessaryEyeHeight: { value: 90, unit: 'cm' }, |
| 87 | + audioIsComprehensible: true, |
| 88 | + optional: false, |
| 89 | + required: true, |
| 90 | + attentionSpan: { value: 10, unit: 's' }, |
| 91 | + duration: { value: 1, unit: 'h' }, |
| 92 | + educationLevel: 3, |
| 93 | +}; |
| 94 | + |
| 95 | +export default perceptionModeFixture; |
| 96 | + |
| 97 | +const definition = getPerceptionModeSchemaDefinition(); |
| 98 | + |
| 99 | +describe('PerceptionMode schema', () => { |
| 100 | + it('validates a completely specified object', () => { |
| 101 | + expectValidFixture(definition, perceptionModeFixture); |
| 102 | + }); |
| 103 | +}); |
0 commit comments