@wcag-checkr/ci 1.0.0-rc.366 → 1.0.0-rc.367
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{ErrorBoundary-BH1wbHb3.js → ErrorBoundary-Ck0XMUiQ.js} +22 -22
- package/dist/assets/{copy-ai-fixer-prompt-FO0N3IMf.js → copy-ai-fixer-prompt-CKp52Td1.js} +2 -2
- package/dist/assets/{devtools-panel-BAHfgRsc.js → devtools-panel-Dw0aFhIc.js} +1 -1
- package/dist/assets/{parallel-tab-flow-C4bjrDqL.js → parallel-tab-flow-BuZZIdRb.js} +1 -1
- package/dist/assets/{scheduled-audit-runner-XCDyFhY6.js → scheduled-audit-runner-9R-aGzwO.js} +137 -137
- package/dist/assets/{service-worker.ts-57FwiS_-.js → service-worker.ts-CyL2aQvI.js} +2 -2
- package/dist/assets/{side-panel-Dl247dJv.js → side-panel-CuEUwRBD.js} +3 -3
- package/dist/assets/{site-report-renderer-CNWZjbOd.js → site-report-renderer-46_JyAkB.js} +1 -1
- package/dist/devtools/panel.html +3 -3
- package/dist/manifest.json +3 -4
- package/dist/service-worker-loader.js +1 -1
- package/dist/side-panel/side-panel.html +4 -4
- package/package.json +1 -1
- package/dist/side-panel/App.tsx +0 -308
- package/dist/side-panel/README.md +0 -57
- package/dist/side-panel/audit-launcher.test.ts +0 -56
- package/dist/side-panel/audit-launcher.ts +0 -98
- package/dist/side-panel/azure-devops-issue.test.ts +0 -68
- package/dist/side-panel/azure-devops-issue.ts +0 -89
- package/dist/side-panel/format-component-id.test.ts +0 -89
- package/dist/side-panel/format-component-id.ts +0 -40
- package/dist/side-panel/github-issue.test.ts +0 -102
- package/dist/side-panel/github-issue.ts +0 -66
- package/dist/side-panel/gitlab-issue.test.ts +0 -53
- package/dist/side-panel/gitlab-issue.ts +0 -78
- package/dist/side-panel/jira-issue.ts +0 -64
- package/dist/side-panel/main.tsx +0 -86
- package/dist/side-panel/store.ts +0 -435
- package/dist/side-panel/styles.css +0 -55
- package/dist/side-panel/use-audit-view-model.ts +0 -116
- package/dist/side-panel/wire-messaging.test.ts +0 -234
- package/dist/side-panel/wire-messaging.ts +0 -521
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, beforeEach } from 'vitest';
|
|
2
|
-
import { installChromeShim, type ChromeShim } from '../shared/test-helpers/chrome-shim';
|
|
3
|
-
|
|
4
|
-
const shim: ChromeShim = installChromeShim();
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
loadLastAudit,
|
|
8
|
-
clearLastAudit,
|
|
9
|
-
clearAllResults,
|
|
10
|
-
refreshBaselineList,
|
|
11
|
-
refreshLicenseTier,
|
|
12
|
-
startKeepalive,
|
|
13
|
-
wireMessaging,
|
|
14
|
-
} from './wire-messaging';
|
|
15
|
-
import { useStore } from './store';
|
|
16
|
-
import { on } from '../shared/messaging';
|
|
17
|
-
import type { AuditResult, DeltaResult } from '../types/audit';
|
|
18
|
-
import type { SiteCrawlReport } from '../shared/site-aggregator';
|
|
19
|
-
|
|
20
|
-
const sampleResult: AuditResult = {
|
|
21
|
-
componentId: '::story:atoms-button--primary',
|
|
22
|
-
scope: '#root',
|
|
23
|
-
state: {
|
|
24
|
-
pseudoState: 'default',
|
|
25
|
-
ariaVariation: null,
|
|
26
|
-
theme: 'light',
|
|
27
|
-
direction: 'ltr',
|
|
28
|
-
breakpoint: {
|
|
29
|
-
id: 'desktop',
|
|
30
|
-
label: 'Desktop',
|
|
31
|
-
width: 1280,
|
|
32
|
-
height: 800,
|
|
33
|
-
deviceScaleFactor: 1,
|
|
34
|
-
mobile: false,
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
violations: [],
|
|
38
|
-
passes: 1,
|
|
39
|
-
incomplete: 0,
|
|
40
|
-
inapplicable: 0,
|
|
41
|
-
axeVersion: '4.11.4',
|
|
42
|
-
startedAt: '2026-04-30T00:00:00Z',
|
|
43
|
-
durationMs: 100,
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
const sampleDelta: DeltaResult = {
|
|
47
|
-
new: [],
|
|
48
|
-
persistent: [],
|
|
49
|
-
fixed: [],
|
|
50
|
-
newCount: 0,
|
|
51
|
-
persistentCount: 0,
|
|
52
|
-
fixedCount: 0,
|
|
53
|
-
baselineSnapshotMeta: null,
|
|
54
|
-
comparedAt: '2026-04-30T00:00:00Z',
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
describe('wire-messaging', () => {
|
|
58
|
-
beforeEach(() => {
|
|
59
|
-
shim.reset();
|
|
60
|
-
useStore.setState({
|
|
61
|
-
status: 'idle',
|
|
62
|
-
progress: null,
|
|
63
|
-
results: [],
|
|
64
|
-
delta: null,
|
|
65
|
-
componentId: null,
|
|
66
|
-
errorMessage: null,
|
|
67
|
-
baselineList: [],
|
|
68
|
-
tier: 'trial',
|
|
69
|
-
view: 'matrix',
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
it('AUDIT_PROGRESS_EVENT updates store progress + status', () => {
|
|
74
|
-
const off = wireMessaging();
|
|
75
|
-
// Simulate event broadcast.
|
|
76
|
-
shim.listeners.forEach((fn) =>
|
|
77
|
-
fn(
|
|
78
|
-
{
|
|
79
|
-
type: 'AUDIT_PROGRESS_EVENT',
|
|
80
|
-
current: 3,
|
|
81
|
-
total: 8,
|
|
82
|
-
currentState: sampleResult.state,
|
|
83
|
-
},
|
|
84
|
-
{},
|
|
85
|
-
() => {}
|
|
86
|
-
)
|
|
87
|
-
);
|
|
88
|
-
const s = useStore.getState();
|
|
89
|
-
expect(s.status).toBe('running');
|
|
90
|
-
expect(s.progress).toEqual({
|
|
91
|
-
current: 3,
|
|
92
|
-
total: 8,
|
|
93
|
-
currentState: sampleResult.state,
|
|
94
|
-
});
|
|
95
|
-
off();
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
it('AUDIT_COMPLETE_EVENT writes results + persists to chrome.storage', async () => {
|
|
99
|
-
const off = wireMessaging();
|
|
100
|
-
shim.listeners.forEach((fn) =>
|
|
101
|
-
fn(
|
|
102
|
-
{
|
|
103
|
-
type: 'AUDIT_COMPLETE_EVENT',
|
|
104
|
-
componentId: '::story:atoms-button--primary',
|
|
105
|
-
results: [sampleResult],
|
|
106
|
-
delta: sampleDelta,
|
|
107
|
-
},
|
|
108
|
-
{},
|
|
109
|
-
() => {}
|
|
110
|
-
)
|
|
111
|
-
);
|
|
112
|
-
const s = useStore.getState();
|
|
113
|
-
expect(s.status).toBe('complete');
|
|
114
|
-
expect(s.componentId).toBe('::story:atoms-button--primary');
|
|
115
|
-
// Wait one microtask for the async persist call.
|
|
116
|
-
await new Promise((r) => setTimeout(r, 0));
|
|
117
|
-
expect(shim.storage.has('sidePanel:lastAudit')).toBe(true);
|
|
118
|
-
off();
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
it('AUDIT_FAILED_EVENT sets error state', () => {
|
|
122
|
-
const off = wireMessaging();
|
|
123
|
-
shim.listeners.forEach((fn) =>
|
|
124
|
-
fn(
|
|
125
|
-
{
|
|
126
|
-
type: 'AUDIT_FAILED_EVENT',
|
|
127
|
-
error: { code: 'AXE_FAILED', message: 'boom', recoverable: false },
|
|
128
|
-
},
|
|
129
|
-
{},
|
|
130
|
-
() => {}
|
|
131
|
-
)
|
|
132
|
-
);
|
|
133
|
-
const s = useStore.getState();
|
|
134
|
-
expect(s.status).toBe('failed');
|
|
135
|
-
expect(s.errorMessage).toBe('boom');
|
|
136
|
-
off();
|
|
137
|
-
});
|
|
138
|
-
|
|
139
|
-
it('LICENSE_CHANGED_EVENT triggers refreshLicenseTier', async () => {
|
|
140
|
-
// Register a handler that responds to TIER_GET so refreshLicenseTier resolves.
|
|
141
|
-
on('TIER_GET', () => ({
|
|
142
|
-
type: 'TIER_GET_RESPONSE',
|
|
143
|
-
tier: 'solo',
|
|
144
|
-
}));
|
|
145
|
-
|
|
146
|
-
const off = wireMessaging();
|
|
147
|
-
shim.listeners.forEach((fn) =>
|
|
148
|
-
fn({ type: 'LICENSE_CHANGED_EVENT', tier: 'solo' }, {}, () => {})
|
|
149
|
-
);
|
|
150
|
-
// Allow the chained promise to resolve.
|
|
151
|
-
await new Promise((r) => setTimeout(r, 5));
|
|
152
|
-
expect(useStore.getState().tier).toBe('solo');
|
|
153
|
-
off();
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
it('loadLastAudit hydrates the store from chrome.storage', async () => {
|
|
157
|
-
shim.storage.set('sidePanel:lastAudit', {
|
|
158
|
-
results: [sampleResult],
|
|
159
|
-
delta: sampleDelta,
|
|
160
|
-
componentId: '::story:atoms-button--primary',
|
|
161
|
-
});
|
|
162
|
-
await loadLastAudit();
|
|
163
|
-
const s = useStore.getState();
|
|
164
|
-
expect(s.status).toBe('complete');
|
|
165
|
-
expect(s.componentId).toBe('::story:atoms-button--primary');
|
|
166
|
-
expect(s.results).toHaveLength(1);
|
|
167
|
-
});
|
|
168
|
-
|
|
169
|
-
it('loadLastAudit is a no-op when no marker exists', async () => {
|
|
170
|
-
await loadLastAudit();
|
|
171
|
-
expect(useStore.getState().status).toBe('idle');
|
|
172
|
-
expect(useStore.getState().results).toEqual([]);
|
|
173
|
-
});
|
|
174
|
-
|
|
175
|
-
it('clearLastAudit removes the persisted marker', async () => {
|
|
176
|
-
shim.storage.set('sidePanel:lastAudit', { results: [], delta: null, componentId: null });
|
|
177
|
-
await clearLastAudit();
|
|
178
|
-
expect(shim.storage.has('sidePanel:lastAudit')).toBe(false);
|
|
179
|
-
});
|
|
180
|
-
|
|
181
|
-
it('clearAllResults wipes the single-page slice AND the crawl pool', async () => {
|
|
182
|
-
// rc.360 regression guard: a bare clearAudit left siteCrawlReport (and
|
|
183
|
-
// its persisted key) in place, so the v1 LastRunBanner / owner-mode
|
|
184
|
-
// CrawlResultGrade resurrected a grade the instant after Clear. The
|
|
185
|
-
// full-wipe helper every "Clear" button now uses must drop both slices.
|
|
186
|
-
shim.storage.set('sidePanel:lastAudit', { results: [sampleResult], delta: sampleDelta, componentId: 'x' });
|
|
187
|
-
shim.storage.set('siteCrawlReport', { startUrl: 'https://e.com', pagesAudited: 2 });
|
|
188
|
-
// rc.361 — an audit-cache entry must also be wiped, else a re-audit of an
|
|
189
|
-
// unchanged page replays it instantly instead of running the check.
|
|
190
|
-
shim.storage.set('auditCache:deadbeef', { lookupKey: 'deadbeef', results: [sampleResult] });
|
|
191
|
-
useStore.setState({
|
|
192
|
-
results: [sampleResult],
|
|
193
|
-
componentId: '::story:atoms-button--primary',
|
|
194
|
-
status: 'complete',
|
|
195
|
-
siteCrawlReport: { startUrl: 'https://e.com', pagesAudited: 2 } as unknown as SiteCrawlReport,
|
|
196
|
-
siteCrawlStatus: 'complete',
|
|
197
|
-
});
|
|
198
|
-
|
|
199
|
-
await clearAllResults();
|
|
200
|
-
|
|
201
|
-
const s = useStore.getState();
|
|
202
|
-
expect(s.results).toEqual([]);
|
|
203
|
-
expect(s.componentId).toBeNull();
|
|
204
|
-
expect(s.siteCrawlReport).toBeNull();
|
|
205
|
-
expect(s.siteCrawlStatus).toBe('idle');
|
|
206
|
-
expect(shim.storage.has('sidePanel:lastAudit')).toBe(false);
|
|
207
|
-
expect(shim.storage.has('siteCrawlReport')).toBe(false);
|
|
208
|
-
expect(shim.storage.has('auditCache:deadbeef')).toBe(false);
|
|
209
|
-
});
|
|
210
|
-
|
|
211
|
-
it('startKeepalive returns a port and registers it with the shim', () => {
|
|
212
|
-
const port = startKeepalive();
|
|
213
|
-
expect(port.name).toBe('audit-keepalive');
|
|
214
|
-
expect(shim.ports.find((p) => p.name === 'audit-keepalive')).toBeTruthy();
|
|
215
|
-
});
|
|
216
|
-
|
|
217
|
-
it('refreshBaselineList writes items into the store', async () => {
|
|
218
|
-
on('BASELINE_LIST', () => ({
|
|
219
|
-
type: 'BASELINE_LIST_RESPONSE',
|
|
220
|
-
items: [
|
|
221
|
-
{ componentId: '::story:a', violationCount: 2, lastUpdated: '2026-04-30T00:00:00Z' },
|
|
222
|
-
],
|
|
223
|
-
}));
|
|
224
|
-
await refreshBaselineList();
|
|
225
|
-
expect(useStore.getState().baselineList).toHaveLength(1);
|
|
226
|
-
expect(useStore.getState().baselineList[0]?.componentId).toBe('::story:a');
|
|
227
|
-
});
|
|
228
|
-
|
|
229
|
-
it('refreshLicenseTier writes tier from TIER_GET response', async () => {
|
|
230
|
-
on('TIER_GET', () => ({ type: 'TIER_GET_RESPONSE', tier: 'team' }));
|
|
231
|
-
await refreshLicenseTier();
|
|
232
|
-
expect(useStore.getState().tier).toBe('team');
|
|
233
|
-
});
|
|
234
|
-
});
|