-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathprocessing.unit.test.ts
More file actions
33 lines (26 loc) · 1.01 KB
/
processing.unit.test.ts
File metadata and controls
33 lines (26 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { describe, expect, it } from 'vitest';
import { processAuditsAndGroups } from './processing.js';
describe('processAuditsAndGroups', () => {
it('should return audits and groups without expansion when analyzing single URL', () => {
const { audits, groups } = processAuditsAndGroups(
['https://example.com'],
'wcag21aa',
);
expect(audits).not.toBeEmpty();
expect(groups).not.toBeEmpty();
expect(audits[0]!.slug).not.toContain('-1');
expect(groups[0]!.slug).not.toContain('-1');
});
it('should expand audits and groups when analyzing multiple URLs', () => {
const { audits, groups } = processAuditsAndGroups(
['https://example.com', 'https://another-example.com'],
'wcag21aa',
);
expect(audits).not.toBeEmpty();
expect(groups).not.toBeEmpty();
expect(audits[0]!.slug).toContain('-1');
expect(groups[0]!.slug).toContain('-1');
expect(audits[0]!.title).toContain('(example.com)');
expect(groups[0]!.title).toContain('(example.com)');
});
});