| 9 | |
| 10 | const createMockResult = (): A11yAuditResult => ({ |
| 11 | issues: [ |
| 12 | { |
| 13 | id: 'issue-1', |
| 14 | ruleId: 'image-alt', |
| 15 | impact: 'critical', |
| 16 | message: 'Images must have alternate text', |
| 17 | help: 'Images must have alternate text', |
| 18 | helpUrl: 'https://dequeuniversity.com/rules/axe/4.0/image-alt', |
| 19 | wcagTags: ['wcag2a', 'wcag111'], |
| 20 | nodes: [ |
| 21 | { |
| 22 | selector: 'img.logo', |
| 23 | html: '<img class="logo" src="logo.png">', |
| 24 | failureSummary: 'Fix this issue by adding an alt attribute', |
| 25 | }, |
| 26 | ], |
| 27 | meetsThreshold: true, |
| 28 | timestamp: 1704067200000, |
| 29 | }, |
| 30 | { |
| 31 | id: 'issue-2', |
| 32 | ruleId: 'button-name', |
| 33 | impact: 'serious', |
| 34 | message: 'Buttons must have discernible text', |
| 35 | help: 'Buttons must have discernible text', |
| 36 | helpUrl: 'https://dequeuniversity.com/rules/axe/4.0/button-name', |
| 37 | wcagTags: ['wcag2a', 'wcag412'], |
| 38 | nodes: [ |
| 39 | { |
| 40 | selector: 'button.submit', |
| 41 | html: '<button class="submit"></button>', |
| 42 | failureSummary: 'Add text or aria-label to the button', |
| 43 | }, |
| 44 | { |
| 45 | selector: 'button.cancel', |
| 46 | html: '<button class="cancel"></button>', |
| 47 | failureSummary: 'Add text or aria-label to the button', |
| 48 | }, |
| 49 | ], |
| 50 | meetsThreshold: true, |
| 51 | timestamp: 1704067200000, |
| 52 | }, |
| 53 | ], |
| 54 | summary: { |
| 55 | total: 2, |
| 56 | critical: 1, |
| 57 | serious: 1, |
| 58 | moderate: 0, |
| 59 | minor: 0, |
| 60 | passes: 50, |
| 61 | incomplete: 3, |
| 62 | }, |
| 63 | timestamp: 1704067200000, |
| 64 | url: 'http://localhost:3000/', |
| 65 | context: 'document', |
| 66 | duration: 123.45, |
| 67 | }) |
| 68 | |