@a11ied/support-data 0.0.0-placeholder → 0.1.0
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/CHANGELOG.md +13 -0
- package/LICENSE +21 -0
- package/NOTICE.md +13 -0
- package/README.md +14 -0
- package/data/aria-at/plans/apg-accordion.json +8543 -0
- package/data/aria-at/plans/apg-alert.json +659 -0
- package/data/aria-at/plans/apg-checkbox.json +4500 -0
- package/data/aria-at/plans/apg-command-button.json +2184 -0
- package/data/aria-at/plans/apg-disclosure-faq.json +4155 -0
- package/data/aria-at/plans/apg-disclosure-navigation.json +13217 -0
- package/data/aria-at/plans/apg-horizontal-slider.json +6310 -0
- package/data/aria-at/plans/apg-link-css.json +2062 -0
- package/data/aria-at/plans/apg-link-img-alt.json +1952 -0
- package/data/aria-at/plans/apg-link-span-text.json +1638 -0
- package/data/aria-at/plans/apg-menu-button-actions-active-descendant.json +9267 -0
- package/data/aria-at/plans/apg-menu-button-actions.json +7156 -0
- package/data/aria-at/plans/apg-menu-button-navigation.json +6971 -0
- package/data/aria-at/plans/apg-minimal-data-grid.json +4768 -0
- package/data/aria-at/plans/apg-modal-dialog.json +5124 -0
- package/data/aria-at/plans/apg-quantity-spin-button.json +3719 -0
- package/data/aria-at/plans/apg-radiogroup-aria-activedescendant.json +12665 -0
- package/data/aria-at/plans/apg-radiogroup-roving-tabindex.json +16098 -0
- package/data/aria-at/plans/apg-rating-radio-group.json +9074 -0
- package/data/aria-at/plans/apg-seek-slider.json +4818 -0
- package/data/aria-at/plans/apg-switch-button.json +5306 -0
- package/data/aria-at/plans/apg-switch-checkbox.json +4462 -0
- package/data/aria-at/plans/apg-switch.json +4408 -0
- package/data/aria-at/plans/apg-tabs-manual-activation.json +7024 -0
- package/data/aria-at/plans/apg-toggle-button.json +5998 -0
- package/data/aria-at/plans/apg-vertical-temperature-slider.json +6642 -0
- package/data/aria-at/plans/html-button.json +1336 -0
- package/data/aria-at/summary.json +1189 -0
- package/data/results/android-13-chrome-talkback.json +2617 -0
- package/data/results/android-13-firefox-talkback.json +22 -0
- package/data/results/android-13-webview-talkback.json +2617 -0
- package/data/results/ios-safari-voiceover.json +22 -0
- package/data/results/ios-wkwebview-voiceover.json +22 -0
- package/data/results/macos-26.3.1-chrome-157.0.8103.79-voiceover.json +2770 -0
- package/data/results/macos-26.3.1-firefox-156.0.1-voiceover.json +2769 -0
- package/data/results/macos-26.3.1-safari-26.3.1-voiceover.json +2749 -0
- package/data/results/macos-26.3.1-wkwebview-21623-voiceover.json +2761 -0
- package/data/results/virtual-chromium-0.32.1.json +3212 -0
- package/dist/chunk-FGZPBJAW.js +127 -0
- package/dist/index.d.ts +212 -0
- package/dist/index.js +1607 -0
- package/dist/types.d.ts +185 -0
- package/dist/types.js +16 -0
- package/package.json +53 -1
package/dist/index.js
ADDED
|
@@ -0,0 +1,1607 @@
|
|
|
1
|
+
import {
|
|
2
|
+
buildEnvironmentKey,
|
|
3
|
+
createEmptyPriorityCounts,
|
|
4
|
+
deriveOutcomeFromSummary,
|
|
5
|
+
formatCategoryLabel,
|
|
6
|
+
formatOutcomeLabel,
|
|
7
|
+
summarizeAssertions
|
|
8
|
+
} from "./chunk-FGZPBJAW.js";
|
|
9
|
+
|
|
10
|
+
// src/aria-at/index.ts
|
|
11
|
+
import { existsSync as existsSync2, readdirSync, readFileSync } from "fs";
|
|
12
|
+
import { resolve as resolve2 } from "path";
|
|
13
|
+
|
|
14
|
+
// src/paths.ts
|
|
15
|
+
import { existsSync } from "fs";
|
|
16
|
+
import { dirname, resolve } from "path";
|
|
17
|
+
import { fileURLToPath } from "url";
|
|
18
|
+
function resolveInstalledPath(specifier) {
|
|
19
|
+
try {
|
|
20
|
+
return fileURLToPath(import.meta.resolve(specifier));
|
|
21
|
+
} catch {
|
|
22
|
+
return void 0;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function resolveDataRootFromPackage() {
|
|
26
|
+
const packageJsonPath = resolveInstalledPath("@a11ied/support-data/package.json");
|
|
27
|
+
if (packageJsonPath) {
|
|
28
|
+
const candidate2 = resolve(dirname(packageJsonPath), "data");
|
|
29
|
+
if (existsSync(candidate2)) {
|
|
30
|
+
return candidate2;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
const packageEntryPath = resolveInstalledPath("@a11ied/support-data");
|
|
34
|
+
if (!packageEntryPath) {
|
|
35
|
+
return void 0;
|
|
36
|
+
}
|
|
37
|
+
const packageDir = dirname(packageEntryPath);
|
|
38
|
+
const candidate = packageDir.endsWith("/dist") ? resolve(packageDir, "../data") : resolve(packageDir, "data");
|
|
39
|
+
return existsSync(candidate) ? candidate : void 0;
|
|
40
|
+
}
|
|
41
|
+
function getDataRootCandidates() {
|
|
42
|
+
return [
|
|
43
|
+
resolve(import.meta.dirname, "../data"),
|
|
44
|
+
resolve(import.meta.dirname, "../../data"),
|
|
45
|
+
resolve(import.meta.dirname, "../../support-data/data"),
|
|
46
|
+
resolve(import.meta.dirname, "../../../packages/support-data/data"),
|
|
47
|
+
resolve(process.cwd(), "packages/support-data/data")
|
|
48
|
+
];
|
|
49
|
+
}
|
|
50
|
+
function resolveSupportDataRoot() {
|
|
51
|
+
const fromPackage = resolveDataRootFromPackage();
|
|
52
|
+
if (fromPackage) {
|
|
53
|
+
return fromPackage;
|
|
54
|
+
}
|
|
55
|
+
for (const candidate of getDataRootCandidates()) {
|
|
56
|
+
if (existsSync(candidate)) {
|
|
57
|
+
return candidate;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return resolve(process.cwd(), "packages/support-data/data");
|
|
61
|
+
}
|
|
62
|
+
function getSupportDataDirectories() {
|
|
63
|
+
const rootDir = resolveSupportDataRoot();
|
|
64
|
+
const ariaAtDir = resolve(rootDir, "aria-at");
|
|
65
|
+
return {
|
|
66
|
+
rootDir,
|
|
67
|
+
resultsDir: resolve(rootDir, "results"),
|
|
68
|
+
ariaAtDir,
|
|
69
|
+
ariaAtPlansDir: resolve(ariaAtDir, "plans"),
|
|
70
|
+
ariaAtSummaryPath: resolve(ariaAtDir, "summary.json")
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// src/aria-at/index.ts
|
|
75
|
+
function isRecord(value) {
|
|
76
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
77
|
+
}
|
|
78
|
+
function isAriaAtPlanFile(value) {
|
|
79
|
+
if (!isRecord(value)) {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
return value.schemaVersion === 1 && typeof value.planVersionID === "string" && typeof value.slug === "string" && Array.isArray(value.reports);
|
|
83
|
+
}
|
|
84
|
+
function isAriaAtSummaryFile(value) {
|
|
85
|
+
if (!isRecord(value)) {
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
return value.schemaVersion === 1 && Array.isArray(value.features) && Array.isArray(value.plans);
|
|
89
|
+
}
|
|
90
|
+
var cacheState = {
|
|
91
|
+
summary: void 0,
|
|
92
|
+
plans: void 0
|
|
93
|
+
};
|
|
94
|
+
function resetAriaAtCache() {
|
|
95
|
+
cacheState.summary = void 0;
|
|
96
|
+
cacheState.plans = void 0;
|
|
97
|
+
}
|
|
98
|
+
function loadPlans() {
|
|
99
|
+
const { ariaAtPlansDir } = getSupportDataDirectories();
|
|
100
|
+
if (!existsSync2(ariaAtPlansDir)) {
|
|
101
|
+
return [];
|
|
102
|
+
}
|
|
103
|
+
const loaded = [];
|
|
104
|
+
const fileNames = readdirSync(ariaAtPlansDir).filter((name) => name.endsWith(".json"));
|
|
105
|
+
for (const fileName of fileNames) {
|
|
106
|
+
const filePath = resolve2(ariaAtPlansDir, fileName);
|
|
107
|
+
const parsed = JSON.parse(readFileSync(filePath, "utf8"));
|
|
108
|
+
if (!isAriaAtPlanFile(parsed)) {
|
|
109
|
+
throw new Error(`Invalid ARIA-AT plan file: ${filePath}`);
|
|
110
|
+
}
|
|
111
|
+
loaded.push(parsed);
|
|
112
|
+
}
|
|
113
|
+
return loaded.toSorted((left, right) => left.title.localeCompare(right.title));
|
|
114
|
+
}
|
|
115
|
+
function getAriaAtSummary() {
|
|
116
|
+
if (cacheState.summary) {
|
|
117
|
+
return cacheState.summary;
|
|
118
|
+
}
|
|
119
|
+
const { ariaAtSummaryPath } = getSupportDataDirectories();
|
|
120
|
+
const parsed = JSON.parse(readFileSync(ariaAtSummaryPath, "utf8"));
|
|
121
|
+
if (!isAriaAtSummaryFile(parsed)) {
|
|
122
|
+
throw new Error(`Invalid ARIA-AT summary.json payload at ${ariaAtSummaryPath}`);
|
|
123
|
+
}
|
|
124
|
+
cacheState.summary = parsed;
|
|
125
|
+
return parsed;
|
|
126
|
+
}
|
|
127
|
+
function listAriaAtPlans() {
|
|
128
|
+
cacheState.plans ??= loadPlans();
|
|
129
|
+
return cacheState.plans;
|
|
130
|
+
}
|
|
131
|
+
function getAriaAtPlanBySlug(slug) {
|
|
132
|
+
return listAriaAtPlans().find((plan) => plan.slug === slug);
|
|
133
|
+
}
|
|
134
|
+
function buildAriaAtEnvTupleKey(report) {
|
|
135
|
+
return [
|
|
136
|
+
report.device,
|
|
137
|
+
report.os,
|
|
138
|
+
report.osVersion,
|
|
139
|
+
report.browserName,
|
|
140
|
+
report.browserVersion,
|
|
141
|
+
report.atName,
|
|
142
|
+
report.atVersion
|
|
143
|
+
].join(" | ");
|
|
144
|
+
}
|
|
145
|
+
function compareLatestTimestamp(existing, candidate) {
|
|
146
|
+
if (!candidate) {
|
|
147
|
+
return existing;
|
|
148
|
+
}
|
|
149
|
+
if (!existing || candidate > existing) {
|
|
150
|
+
return candidate;
|
|
151
|
+
}
|
|
152
|
+
return existing;
|
|
153
|
+
}
|
|
154
|
+
function accumulateAriaAtReport(grouped, planVersionID, report) {
|
|
155
|
+
const key = buildAriaAtEnvTupleKey(report);
|
|
156
|
+
let bucket = grouped.get(key);
|
|
157
|
+
if (!bucket) {
|
|
158
|
+
bucket = {
|
|
159
|
+
screenReader: report.atName,
|
|
160
|
+
screenReaderVersion: report.atVersion,
|
|
161
|
+
browser: report.browserName,
|
|
162
|
+
browserVersion: report.browserVersion,
|
|
163
|
+
os: report.os,
|
|
164
|
+
osVersion: report.osVersion,
|
|
165
|
+
device: report.device,
|
|
166
|
+
planIDs: /* @__PURE__ */ new Set(),
|
|
167
|
+
...report.markedFinalAt ? { latestTestedAt: report.markedFinalAt } : {}
|
|
168
|
+
};
|
|
169
|
+
grouped.set(key, bucket);
|
|
170
|
+
}
|
|
171
|
+
bucket.planIDs.add(planVersionID);
|
|
172
|
+
const nextLatest = compareLatestTimestamp(bucket.latestTestedAt, report.markedFinalAt);
|
|
173
|
+
if (nextLatest) {
|
|
174
|
+
bucket.latestTestedAt = nextLatest;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
function listAriaAtEnvironments() {
|
|
178
|
+
const grouped = /* @__PURE__ */ new Map();
|
|
179
|
+
for (const plan of listAriaAtPlans()) {
|
|
180
|
+
for (const report of plan.reports) {
|
|
181
|
+
accumulateAriaAtReport(grouped, plan.planVersionID, report);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
const result = [];
|
|
185
|
+
for (const [key, item] of grouped.entries()) {
|
|
186
|
+
result.push({
|
|
187
|
+
key,
|
|
188
|
+
screenReader: item.screenReader,
|
|
189
|
+
screenReaderVersion: item.screenReaderVersion,
|
|
190
|
+
browser: item.browser,
|
|
191
|
+
browserVersion: item.browserVersion,
|
|
192
|
+
os: item.os,
|
|
193
|
+
osVersion: item.osVersion,
|
|
194
|
+
device: item.device,
|
|
195
|
+
planCount: item.planIDs.size,
|
|
196
|
+
...item.latestTestedAt ? { latestTestedAt: item.latestTestedAt } : {}
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
return result.toSorted((left, right) => {
|
|
200
|
+
const atDiff = left.screenReader.localeCompare(right.screenReader);
|
|
201
|
+
if (atDiff !== 0) {
|
|
202
|
+
return atDiff;
|
|
203
|
+
}
|
|
204
|
+
const atVerDiff = right.screenReaderVersion.localeCompare(left.screenReaderVersion);
|
|
205
|
+
if (atVerDiff !== 0) {
|
|
206
|
+
return atVerDiff;
|
|
207
|
+
}
|
|
208
|
+
return left.browser.localeCompare(right.browser);
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
// src/cases/aria-current.ts
|
|
213
|
+
var ARIA_CURRENT_REF = {
|
|
214
|
+
title: "WAI-ARIA 1.2: aria-current state",
|
|
215
|
+
url: "https://www.w3.org/TR/wai-aria-1.2/#aria-current",
|
|
216
|
+
section: "6.6.4 aria-current"
|
|
217
|
+
};
|
|
218
|
+
var ariaCurrentCases = [
|
|
219
|
+
{
|
|
220
|
+
slug: "aria-current-page",
|
|
221
|
+
title: "aria-current: Announces current page on navigation link",
|
|
222
|
+
isolatedTitle: "aria-current page test",
|
|
223
|
+
category: "aria",
|
|
224
|
+
featureGroup: "Navigation State",
|
|
225
|
+
attribute: "aria-current",
|
|
226
|
+
tags: ["aria-current", "page", "navigation", "link"],
|
|
227
|
+
summary: 'Tests whether aria-current="page" on the active navigation link announces its current-page state.',
|
|
228
|
+
expectedBehavior: 'The "Pricing" link should announce "current page" (or "current") alongside its name and link role, while "Home" does not.',
|
|
229
|
+
specReferences: [ARIA_CURRENT_REF],
|
|
230
|
+
html: `<nav aria-label="Main">
|
|
231
|
+
<a href="#home">Home</a>
|
|
232
|
+
<a href="#pricing" aria-current="page">Pricing</a>
|
|
233
|
+
</nav>`,
|
|
234
|
+
evaluation: {
|
|
235
|
+
mode: "walk",
|
|
236
|
+
targetRoleHint: "link",
|
|
237
|
+
expectedPhrases: ["Pricing"],
|
|
238
|
+
expectedStateTerms: ["current page"]
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
slug: "aria-current-step",
|
|
243
|
+
title: "aria-current: Announces current step in multi-step list",
|
|
244
|
+
isolatedTitle: "aria-current step test",
|
|
245
|
+
category: "aria",
|
|
246
|
+
featureGroup: "Navigation State",
|
|
247
|
+
attribute: "aria-current",
|
|
248
|
+
tags: ["aria-current", "step", "list", "wizard"],
|
|
249
|
+
summary: 'Tests whether aria-current="step" on a list item in a multi-step checkout progress indicator is announced by screen readers.',
|
|
250
|
+
expectedBehavior: 'The "Shipping" item should be announced with a "current step" (or "current") indicator.',
|
|
251
|
+
specReferences: [ARIA_CURRENT_REF],
|
|
252
|
+
html: `<ol>
|
|
253
|
+
<li>Account</li>
|
|
254
|
+
<li aria-current="step">Shipping</li>
|
|
255
|
+
<li>Payment</li>
|
|
256
|
+
</ol>`,
|
|
257
|
+
evaluation: {
|
|
258
|
+
mode: "walk",
|
|
259
|
+
expectedPhrases: ["Shipping"],
|
|
260
|
+
expectedStateTerms: ["current step"]
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
];
|
|
264
|
+
|
|
265
|
+
// src/cases/aria-describedby.ts
|
|
266
|
+
var ARIA_DESCRIBEDBY_REF = {
|
|
267
|
+
title: "WAI-ARIA 1.2: aria-describedby property",
|
|
268
|
+
url: "https://www.w3.org/TR/wai-aria-1.2/#aria-describedby",
|
|
269
|
+
section: "6.6.1 aria-describedby"
|
|
270
|
+
};
|
|
271
|
+
var ACCNAME_DESC_REF = {
|
|
272
|
+
title: "Accessible Name and Description Computation 1.2: Accessible Description",
|
|
273
|
+
url: "https://www.w3.org/TR/accname-1.2/#mapping_additional_nd_description",
|
|
274
|
+
section: "4.1 Accessible Description Computation"
|
|
275
|
+
};
|
|
276
|
+
var ariaDescribedbyCases = [
|
|
277
|
+
{
|
|
278
|
+
slug: "aria-describedby-input-hint",
|
|
279
|
+
title: "aria-describedby: Associates help text with form input",
|
|
280
|
+
isolatedTitle: "aria-describedby input hint test",
|
|
281
|
+
category: "aria",
|
|
282
|
+
featureGroup: "Accessible Description",
|
|
283
|
+
attribute: "aria-describedby",
|
|
284
|
+
tags: ["aria-describedby", "input", "form", "description"],
|
|
285
|
+
summary: "Tests whether a text input labeled via <label> announces its programmatically associated hint text from aria-describedby.",
|
|
286
|
+
expectedBehavior: 'The text input should announce its accessible name ("API token") and its accessible description ("Starts with sk_live").',
|
|
287
|
+
specReferences: [ARIA_DESCRIBEDBY_REF, ACCNAME_DESC_REF],
|
|
288
|
+
html: `<label for="api-key">API token</label>
|
|
289
|
+
<input id="api-key" type="text" aria-describedby="api-hint" />
|
|
290
|
+
<p id="api-hint">Starts with sk_live</p>`,
|
|
291
|
+
evaluation: {
|
|
292
|
+
mode: "walk",
|
|
293
|
+
targetRoleHint: "text",
|
|
294
|
+
expectedPhrases: ["API token"],
|
|
295
|
+
expectedStateTerms: ["Starts with sk_live"]
|
|
296
|
+
}
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
slug: "aria-describedby-multiple-ids",
|
|
300
|
+
title: "aria-describedby: Concatenates multiple description IDs",
|
|
301
|
+
isolatedTitle: "aria-describedby multiple IDs test",
|
|
302
|
+
category: "aria",
|
|
303
|
+
featureGroup: "Accessible Description",
|
|
304
|
+
attribute: "aria-describedby",
|
|
305
|
+
tags: ["aria-describedby", "multiple-ids", "button", "description"],
|
|
306
|
+
summary: "Tests whether aria-describedby concatenates multiple space-separated IDs into a single accessible description on a button.",
|
|
307
|
+
expectedBehavior: 'The button should announce "Delete project" along with both descriptions: "Permanent action." and "Cannot be undone.".',
|
|
308
|
+
specReferences: [ARIA_DESCRIBEDBY_REF, ACCNAME_DESC_REF],
|
|
309
|
+
html: `<button type="button" aria-describedby="desc-one desc-two">Delete project</button>
|
|
310
|
+
<p id="desc-one">Permanent action.</p>
|
|
311
|
+
<p id="desc-two">Cannot be undone.</p>`,
|
|
312
|
+
evaluation: {
|
|
313
|
+
mode: "walk",
|
|
314
|
+
targetRoleHint: "button",
|
|
315
|
+
expectedPhrases: ["Delete project"],
|
|
316
|
+
expectedStateTerms: ["Permanent action", "Cannot be undone"]
|
|
317
|
+
}
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
slug: "aria-describedby-hidden-target",
|
|
321
|
+
title: "aria-describedby: References display: none description",
|
|
322
|
+
isolatedTitle: "aria-describedby hidden target test",
|
|
323
|
+
category: "aria",
|
|
324
|
+
featureGroup: "Accessible Description",
|
|
325
|
+
attribute: "aria-describedby",
|
|
326
|
+
tags: ["aria-describedby", "display-none", "hidden-description", "button"],
|
|
327
|
+
summary: "Tests whether a display: none element referenced directly by aria-describedby still provides the accessible description for a button.",
|
|
328
|
+
expectedBehavior: 'The hidden paragraph should not appear in cursor navigation, while the button announces "Submit form" with description "Sends application immediately".',
|
|
329
|
+
specReferences: [ARIA_DESCRIBEDBY_REF, ACCNAME_DESC_REF],
|
|
330
|
+
html: `<button type="button" aria-describedby="hidden-desc">Submit form</button>
|
|
331
|
+
<p id="hidden-desc" style="display: none;">Sends application immediately</p>`,
|
|
332
|
+
evaluation: {
|
|
333
|
+
mode: "walk",
|
|
334
|
+
targetRoleHint: "button",
|
|
335
|
+
expectedPhrases: ["Submit form"],
|
|
336
|
+
expectedStateTerms: ["Sends application immediately"]
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
];
|
|
340
|
+
|
|
341
|
+
// src/cases/aria-disabled.ts
|
|
342
|
+
var ARIA_DISABLED_REF = {
|
|
343
|
+
title: "WAI-ARIA 1.2: aria-disabled state",
|
|
344
|
+
url: "https://www.w3.org/TR/wai-aria-1.2/#aria-disabled",
|
|
345
|
+
section: "6.6.4 aria-disabled"
|
|
346
|
+
};
|
|
347
|
+
var ariaDisabledCases = [
|
|
348
|
+
{
|
|
349
|
+
slug: "aria-disabled-button",
|
|
350
|
+
title: "aria-disabled: Button remains focusable and announces disabled state",
|
|
351
|
+
isolatedTitle: "aria-disabled button test",
|
|
352
|
+
category: "aria",
|
|
353
|
+
featureGroup: "Widget States",
|
|
354
|
+
attribute: "aria-disabled",
|
|
355
|
+
tags: ["aria-disabled", "button", "dimmed", "disabled"],
|
|
356
|
+
summary: 'Tests whether a button with aria-disabled="true" remains reachable and announces its disabled/dimmed state.',
|
|
357
|
+
expectedBehavior: 'The screen reader should reach the button and announce "Publish changes", button, and a disabled state ("disabled", "dimmed", or "unavailable").',
|
|
358
|
+
specReferences: [ARIA_DISABLED_REF],
|
|
359
|
+
html: `<button type="button" aria-disabled="true">Publish changes</button>`,
|
|
360
|
+
evaluation: {
|
|
361
|
+
mode: "walk",
|
|
362
|
+
targetRoleHint: "button",
|
|
363
|
+
expectedPhrases: ["Publish changes"],
|
|
364
|
+
expectedStateTerms: ["disabled"]
|
|
365
|
+
}
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
slug: "aria-disabled-link",
|
|
369
|
+
title: "aria-disabled: Link announces disabled state",
|
|
370
|
+
isolatedTitle: "aria-disabled link test",
|
|
371
|
+
category: "aria",
|
|
372
|
+
featureGroup: "Widget States",
|
|
373
|
+
attribute: "aria-disabled",
|
|
374
|
+
tags: ["aria-disabled", "link", "dimmed", "disabled"],
|
|
375
|
+
summary: 'Tests whether an anchor element with aria-disabled="true" conveys its disabled/dimmed state to screen readers.',
|
|
376
|
+
expectedBehavior: 'The link should announce "Download archive", link, and a disabled state ("disabled", "dimmed", or "unavailable").',
|
|
377
|
+
specReferences: [ARIA_DISABLED_REF],
|
|
378
|
+
html: `<a href="#archive" aria-disabled="true">Download archive</a>`,
|
|
379
|
+
evaluation: {
|
|
380
|
+
mode: "walk",
|
|
381
|
+
targetRoleHint: "link",
|
|
382
|
+
expectedPhrases: ["Download archive"],
|
|
383
|
+
expectedStateTerms: ["disabled"]
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
];
|
|
387
|
+
|
|
388
|
+
// src/cases/aria-expanded.ts
|
|
389
|
+
var ARIA_EXPANDED_REF = {
|
|
390
|
+
title: "WAI-ARIA 1.2: aria-expanded state",
|
|
391
|
+
url: "https://www.w3.org/TR/wai-aria-1.2/#aria-expanded",
|
|
392
|
+
section: "6.6.4 aria-expanded"
|
|
393
|
+
};
|
|
394
|
+
var ariaExpandedCases = [
|
|
395
|
+
{
|
|
396
|
+
slug: "aria-expanded-false-initial",
|
|
397
|
+
title: "aria-expanded: Announces collapsed state for false",
|
|
398
|
+
isolatedTitle: "aria-expanded false initial test",
|
|
399
|
+
category: "aria",
|
|
400
|
+
featureGroup: "Widget States",
|
|
401
|
+
attribute: "aria-expanded",
|
|
402
|
+
tags: ["aria-expanded", "button", "collapsed", "disclosure"],
|
|
403
|
+
summary: 'Tests whether a disclosure button with aria-expanded="false" announces its collapsed state alongside its label and button role.',
|
|
404
|
+
expectedBehavior: 'The button should announce "Account menu", role button, and its collapsed state ("collapsed").',
|
|
405
|
+
specReferences: [ARIA_EXPANDED_REF],
|
|
406
|
+
html: `<button type="button" aria-expanded="false">Account menu</button>`,
|
|
407
|
+
evaluation: {
|
|
408
|
+
mode: "walk",
|
|
409
|
+
targetRoleHint: "button",
|
|
410
|
+
expectedPhrases: ["Account menu"],
|
|
411
|
+
expectedStateTerms: ["collapsed"]
|
|
412
|
+
}
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
slug: "aria-expanded-toggle-dynamic",
|
|
416
|
+
title: "aria-expanded: Updates from collapsed to expanded on activation",
|
|
417
|
+
isolatedTitle: "aria-expanded dynamic toggle test",
|
|
418
|
+
category: "aria",
|
|
419
|
+
featureGroup: "Widget States",
|
|
420
|
+
attribute: "aria-expanded",
|
|
421
|
+
tags: ["aria-expanded", "dynamic", "toggle", "disclosure"],
|
|
422
|
+
summary: "Tests whether activating an aria-expanded button updates its state from collapsed to expanded and announces the expanded state.",
|
|
423
|
+
expectedBehavior: 'Initially the "Details" button announces collapsed; after activation it updates aria-expanded="true", reveals #panel, and announces expanded.',
|
|
424
|
+
specReferences: [ARIA_EXPANDED_REF],
|
|
425
|
+
html: `<button type="button" id="toggle-btn" aria-expanded="false" aria-controls="panel">Details</button>
|
|
426
|
+
<div id="panel" hidden>Panel details content</div>`,
|
|
427
|
+
js: `const toggleBtn = document.getElementById('toggle-btn');
|
|
428
|
+
const panel = document.getElementById('panel');
|
|
429
|
+
toggleBtn?.addEventListener('click', () => {
|
|
430
|
+
const nextExpanded = toggleBtn.getAttribute('aria-expanded') !== 'true';
|
|
431
|
+
toggleBtn.setAttribute('aria-expanded', String(nextExpanded));
|
|
432
|
+
if (panel) {
|
|
433
|
+
panel.hidden = !nextExpanded;
|
|
434
|
+
}
|
|
435
|
+
});`,
|
|
436
|
+
evaluation: {
|
|
437
|
+
mode: "interact",
|
|
438
|
+
targetRoleHint: "button",
|
|
439
|
+
activateButtonText: "Details",
|
|
440
|
+
preActionExpectedPhrases: ["Details"],
|
|
441
|
+
expectedPhrases: ["expanded"],
|
|
442
|
+
expectedStateTerms: ["expanded"]
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
];
|
|
446
|
+
|
|
447
|
+
// src/cases/aria-hidden.ts
|
|
448
|
+
var ARIA_HIDDEN_REF = {
|
|
449
|
+
title: "WAI-ARIA 1.2: aria-hidden state",
|
|
450
|
+
url: "https://www.w3.org/TR/wai-aria-1.2/#aria-hidden",
|
|
451
|
+
section: "6.6.4 aria-hidden"
|
|
452
|
+
};
|
|
453
|
+
var ariaHiddenCases = [
|
|
454
|
+
{
|
|
455
|
+
slug: "aria-hidden-true-text",
|
|
456
|
+
title: "aria-hidden: Hides visible content from screen reader",
|
|
457
|
+
isolatedTitle: "aria-hidden true text test",
|
|
458
|
+
category: "aria",
|
|
459
|
+
featureGroup: "Tree Inclusion",
|
|
460
|
+
attribute: "aria-hidden",
|
|
461
|
+
tags: ["aria-hidden", "visibility", "accessibility-tree"],
|
|
462
|
+
summary: 'Tests whether an element with aria-hidden="true" is excluded from screen reader cursor navigation while remaining visually rendered.',
|
|
463
|
+
expectedBehavior: 'The screen reader should read "Visible sentence" and skip "Hidden decorative text" completely.',
|
|
464
|
+
specReferences: [ARIA_HIDDEN_REF],
|
|
465
|
+
html: `<p>Visible sentence</p>
|
|
466
|
+
<p aria-hidden="true">Hidden decorative text</p>`,
|
|
467
|
+
evaluation: {
|
|
468
|
+
mode: "walk",
|
|
469
|
+
expectedPhrases: ["Visible sentence"],
|
|
470
|
+
forbiddenPhrases: ["Hidden decorative text"]
|
|
471
|
+
}
|
|
472
|
+
},
|
|
473
|
+
{
|
|
474
|
+
slug: "aria-hidden-false-inside-true",
|
|
475
|
+
title: 'aria-hidden: Descendant aria-hidden="false" stays hidden',
|
|
476
|
+
isolatedTitle: "aria-hidden false inside true test",
|
|
477
|
+
category: "aria",
|
|
478
|
+
featureGroup: "Tree Inclusion",
|
|
479
|
+
attribute: "aria-hidden",
|
|
480
|
+
tags: ["aria-hidden", "inheritance", "accessibility-tree"],
|
|
481
|
+
summary: 'Tests the WAI-ARIA 1.2 rule that aria-hidden="false" on a child does NOT override aria-hidden="true" on an ancestor.',
|
|
482
|
+
expectedBehavior: 'Neither "Hidden parent text" nor "Nested aria-hidden false" should be exposed; only "After hidden block" should be read.',
|
|
483
|
+
specReferences: [ARIA_HIDDEN_REF],
|
|
484
|
+
html: `<div aria-hidden="true">
|
|
485
|
+
<p>Hidden parent text</p>
|
|
486
|
+
<p aria-hidden="false">Nested aria-hidden false</p>
|
|
487
|
+
</div>
|
|
488
|
+
<p>After hidden block</p>`,
|
|
489
|
+
evaluation: {
|
|
490
|
+
mode: "walk",
|
|
491
|
+
expectedPhrases: ["After hidden block"],
|
|
492
|
+
forbiddenPhrases: ["Hidden parent text", "Nested aria-hidden false"]
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
];
|
|
496
|
+
|
|
497
|
+
// src/cases/aria-label.ts
|
|
498
|
+
var ARIA_LABEL_REF = {
|
|
499
|
+
title: "WAI-ARIA 1.2: aria-label property",
|
|
500
|
+
url: "https://www.w3.org/TR/wai-aria-1.2/#aria-label",
|
|
501
|
+
section: "6.6.1 aria-label"
|
|
502
|
+
};
|
|
503
|
+
var ACCNAME_STEP_2C_REF = {
|
|
504
|
+
title: "Accessible Name and Description Computation 1.2: Step 2C",
|
|
505
|
+
url: "https://www.w3.org/TR/accname-1.2/#step2C",
|
|
506
|
+
section: "4.3.1 Step 2C (aria-label)"
|
|
507
|
+
};
|
|
508
|
+
var NAME_PROHIBITED_REF = {
|
|
509
|
+
title: "WAI-ARIA 1.2: Roles Prohibiting Naming",
|
|
510
|
+
url: "https://www.w3.org/TR/wai-aria-1.2/#namefromprohibited",
|
|
511
|
+
section: "5.2.8.4 Roles Supporting Name from Author / Prohibited"
|
|
512
|
+
};
|
|
513
|
+
var ariaLabelCases = [
|
|
514
|
+
{
|
|
515
|
+
slug: "aria-label-button-override",
|
|
516
|
+
title: "aria-label: Overrides visible button text",
|
|
517
|
+
isolatedTitle: "aria-label button override test",
|
|
518
|
+
category: "aria",
|
|
519
|
+
featureGroup: "Accessible Naming",
|
|
520
|
+
attribute: "aria-label",
|
|
521
|
+
tags: ["aria-label", "button", "override", "accname"],
|
|
522
|
+
summary: 'Tests whether aria-label on a native button replaces its inner visible text ("X") with the accessible label ("Close settings dialog").',
|
|
523
|
+
expectedBehavior: 'The button should announce "Close settings dialog" with button role, overriding "X".',
|
|
524
|
+
specReferences: [ARIA_LABEL_REF, ACCNAME_STEP_2C_REF],
|
|
525
|
+
html: `<button type="button" aria-label="Close settings dialog">X</button>`,
|
|
526
|
+
evaluation: {
|
|
527
|
+
mode: "walk",
|
|
528
|
+
targetRoleHint: "button",
|
|
529
|
+
expectedPhrases: ["Close settings dialog"],
|
|
530
|
+
forbiddenPhrases: ["X"]
|
|
531
|
+
}
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
slug: "aria-label-landmark-nav",
|
|
535
|
+
title: "aria-label: Names a navigation landmark region",
|
|
536
|
+
isolatedTitle: "aria-label landmark navigation test",
|
|
537
|
+
category: "aria",
|
|
538
|
+
featureGroup: "Accessible Naming",
|
|
539
|
+
attribute: "aria-label",
|
|
540
|
+
tags: ["aria-label", "nav", "landmark", "navigation"],
|
|
541
|
+
summary: "Tests whether aria-label on a <nav> element exposes an accessible name for the navigation landmark.",
|
|
542
|
+
expectedBehavior: 'The navigation landmark should expose the accessible name "Breadcrumb trail" along with its navigation role and inner link "Home".',
|
|
543
|
+
specReferences: [ARIA_LABEL_REF, ACCNAME_STEP_2C_REF],
|
|
544
|
+
html: `<nav aria-label="Breadcrumb trail">
|
|
545
|
+
<a href="#home">Home</a>
|
|
546
|
+
</nav>`,
|
|
547
|
+
evaluation: {
|
|
548
|
+
mode: "walk",
|
|
549
|
+
targetRoleHint: "navigation",
|
|
550
|
+
expectedPhrases: ["Breadcrumb trail"]
|
|
551
|
+
}
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
slug: "aria-label-prohibited-span",
|
|
555
|
+
title: "aria-label: Ignored on generic span (naming prohibited)",
|
|
556
|
+
isolatedTitle: "aria-label prohibited on span test",
|
|
557
|
+
category: "aria",
|
|
558
|
+
featureGroup: "Accessible Naming",
|
|
559
|
+
attribute: "aria-label",
|
|
560
|
+
tags: ["aria-label", "generic", "span", "name-prohibited"],
|
|
561
|
+
summary: "Tests whether screen readers ignore aria-label on a generic <span> element whose role prohibits naming.",
|
|
562
|
+
expectedBehavior: 'Because generic elements prohibit naming from author, the screen reader should read "Visible text" and MUST NOT replace it with "Secret label".',
|
|
563
|
+
specReferences: [ARIA_LABEL_REF, NAME_PROHIBITED_REF],
|
|
564
|
+
html: `<span aria-label="Secret label">Visible text</span>`,
|
|
565
|
+
evaluation: {
|
|
566
|
+
mode: "walk",
|
|
567
|
+
expectedPhrases: ["Visible text"],
|
|
568
|
+
forbiddenPhrases: ["Secret label"]
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
];
|
|
572
|
+
|
|
573
|
+
// src/cases/aria-labelledby.ts
|
|
574
|
+
var WAI_ARIA_LABELLEDBY_REF = {
|
|
575
|
+
title: "WAI-ARIA 1.2: aria-labelledby property",
|
|
576
|
+
url: "https://www.w3.org/TR/wai-aria-1.2/#aria-labelledby",
|
|
577
|
+
section: "6.6.1 aria-labelledby"
|
|
578
|
+
};
|
|
579
|
+
var ACCNAME_STEP_2B_REF = {
|
|
580
|
+
title: "Accessible Name and Description Computation 1.2: Step 2B",
|
|
581
|
+
url: "https://www.w3.org/TR/accname-1.2/#step2B",
|
|
582
|
+
section: "4.3.1 Step 2B (aria-labelledby)"
|
|
583
|
+
};
|
|
584
|
+
var ACCNAME_PRECEDENCE_REF = {
|
|
585
|
+
title: "Accessible Name and Description Computation 1.2: Computation Steps",
|
|
586
|
+
url: "https://www.w3.org/TR/accname-1.2/#mapping_additional_nd_te",
|
|
587
|
+
section: "4.3 Text Alternative Computation"
|
|
588
|
+
};
|
|
589
|
+
var NAME_PROHIBITED_REF2 = {
|
|
590
|
+
title: "WAI-ARIA 1.2: Roles Prohibiting Naming",
|
|
591
|
+
url: "https://www.w3.org/TR/wai-aria-1.2/#namefromprohibited",
|
|
592
|
+
section: "5.2.8.4 Roles Supporting Name from Author / Prohibited"
|
|
593
|
+
};
|
|
594
|
+
var HTML_AAM_REF = {
|
|
595
|
+
title: "HTML Accessibility API Mappings 1.0",
|
|
596
|
+
url: "https://www.w3.org/TR/html-aam-1.0/#accname-and-description-computation",
|
|
597
|
+
section: "4. Accessible Name and Description Computation"
|
|
598
|
+
};
|
|
599
|
+
var ariaLabelledbyCases = [
|
|
600
|
+
{
|
|
601
|
+
slug: "aria-labelledby-single-id",
|
|
602
|
+
title: "aria-labelledby: Single ID overrides button text",
|
|
603
|
+
isolatedTitle: "aria-labelledby single ID test",
|
|
604
|
+
category: "aria",
|
|
605
|
+
featureGroup: "Accessible Naming",
|
|
606
|
+
attribute: "aria-labelledby",
|
|
607
|
+
tags: ["aria-labelledby", "button", "accname", "override"],
|
|
608
|
+
summary: "Tests whether a button with aria-labelledby pointing to a single external heading announces the referenced heading text instead of its inner text.",
|
|
609
|
+
expectedBehavior: 'The heading is announced as "Billing address", and the button is announced with accessible name "Billing address" (role button), completely overriding its inner text "Edit".',
|
|
610
|
+
specReferences: [WAI_ARIA_LABELLEDBY_REF, ACCNAME_STEP_2B_REF],
|
|
611
|
+
html: `<h2 id="billing-heading">Billing address</h2>
|
|
612
|
+
<button type="button" aria-labelledby="billing-heading">Edit</button>`,
|
|
613
|
+
evaluation: {
|
|
614
|
+
mode: "walk",
|
|
615
|
+
targetRoleHint: "button",
|
|
616
|
+
expectedPhrases: ["Billing address"],
|
|
617
|
+
forbiddenPhrases: ["Edit"],
|
|
618
|
+
minimumOccurrences: 2
|
|
619
|
+
}
|
|
620
|
+
},
|
|
621
|
+
{
|
|
622
|
+
slug: "aria-labelledby-multiple-ids",
|
|
623
|
+
title: "aria-labelledby: Multiple space-separated IDs",
|
|
624
|
+
isolatedTitle: "aria-labelledby multiple IDs test",
|
|
625
|
+
category: "aria",
|
|
626
|
+
featureGroup: "Accessible Naming",
|
|
627
|
+
attribute: "aria-labelledby",
|
|
628
|
+
tags: ["aria-labelledby", "multiple-ids", "concatenation", "button"],
|
|
629
|
+
summary: "Tests whether aria-labelledby concatenates text from multiple space-separated ID references into one accessible name on a button.",
|
|
630
|
+
expectedBehavior: 'The button should announce "Delete quarterly invoice" by joining the text of #action-verb and #item-name with spaces, ignoring its inner "X" text.',
|
|
631
|
+
specReferences: [WAI_ARIA_LABELLEDBY_REF, ACCNAME_STEP_2B_REF],
|
|
632
|
+
html: `<p><span id="action-verb">Delete</span> <span id="item-name">quarterly invoice</span></p>
|
|
633
|
+
<button type="button" aria-labelledby="action-verb item-name">X</button>`,
|
|
634
|
+
evaluation: {
|
|
635
|
+
mode: "walk",
|
|
636
|
+
targetRoleHint: "button",
|
|
637
|
+
expectedPhrases: ["Delete quarterly invoice"],
|
|
638
|
+
forbiddenPhrases: ["X, button", "button X"]
|
|
639
|
+
}
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
slug: "aria-labelledby-reverse-dom-order",
|
|
643
|
+
title: "aria-labelledby: Attribute ID order overrides DOM order",
|
|
644
|
+
isolatedTitle: "aria-labelledby reverse DOM order test",
|
|
645
|
+
category: "aria",
|
|
646
|
+
featureGroup: "Accessible Naming",
|
|
647
|
+
attribute: "aria-labelledby",
|
|
648
|
+
tags: ["aria-labelledby", "id-order", "dom-order", "button"],
|
|
649
|
+
summary: "Tests whether screen readers concatenate referenced elements in the order specified in the aria-labelledby attribute rather than their DOM order.",
|
|
650
|
+
expectedBehavior: 'Because aria-labelledby="adj-part noun-part" lists #adj-part first, the button must announce "Account settings" even though #noun-part ("settings") appears earlier in the DOM.',
|
|
651
|
+
specReferences: [WAI_ARIA_LABELLEDBY_REF, ACCNAME_STEP_2B_REF],
|
|
652
|
+
html: `<p><span id="noun-part">settings</span> <span id="adj-part">Account</span></p>
|
|
653
|
+
<button type="button" aria-labelledby="adj-part noun-part">Open</button>`,
|
|
654
|
+
evaluation: {
|
|
655
|
+
mode: "walk",
|
|
656
|
+
targetRoleHint: "button",
|
|
657
|
+
expectedPhrases: ["Account settings"],
|
|
658
|
+
forbiddenPhrases: ["settings Account, button", "Open"]
|
|
659
|
+
}
|
|
660
|
+
},
|
|
661
|
+
{
|
|
662
|
+
slug: "aria-labelledby-self-reference",
|
|
663
|
+
title: "aria-labelledby: Self-referencing ID plus external label",
|
|
664
|
+
isolatedTitle: "aria-labelledby self-reference test",
|
|
665
|
+
category: "aria",
|
|
666
|
+
featureGroup: "Accessible Naming",
|
|
667
|
+
attribute: "aria-labelledby",
|
|
668
|
+
tags: ["aria-labelledby", "self-reference", "concatenation", "button"],
|
|
669
|
+
summary: "Tests whether an element can reference its own ID alongside another element ID to combine its inner text with external context.",
|
|
670
|
+
expectedBehavior: 'The button should announce "Remove Monthly plan" by resolving #remove-btn first and appending #plan-name.',
|
|
671
|
+
specReferences: [WAI_ARIA_LABELLEDBY_REF, ACCNAME_STEP_2B_REF],
|
|
672
|
+
html: `<p id="plan-name">Monthly plan</p>
|
|
673
|
+
<button type="button" id="remove-btn" aria-labelledby="remove-btn plan-name">Remove</button>`,
|
|
674
|
+
evaluation: {
|
|
675
|
+
mode: "walk",
|
|
676
|
+
targetRoleHint: "button",
|
|
677
|
+
expectedPhrases: ["Remove Monthly plan"]
|
|
678
|
+
}
|
|
679
|
+
},
|
|
680
|
+
{
|
|
681
|
+
slug: "aria-labelledby-display-none-target",
|
|
682
|
+
title: "aria-labelledby: References display: none target",
|
|
683
|
+
isolatedTitle: "aria-labelledby display none target test",
|
|
684
|
+
category: "aria",
|
|
685
|
+
featureGroup: "Accessible Naming",
|
|
686
|
+
attribute: "aria-labelledby",
|
|
687
|
+
tags: ["aria-labelledby", "display-none", "hidden-label", "accname"],
|
|
688
|
+
summary: "Tests the AccName 1.2 rule that a hidden element (display: none) still supplies its text when directly referenced by aria-labelledby.",
|
|
689
|
+
expectedBehavior: 'The display: none span must NOT appear as a separate item in the screen reader cursor order, yet the button MUST announce "Export CSV report" instead of "Download".',
|
|
690
|
+
specReferences: [WAI_ARIA_LABELLEDBY_REF, ACCNAME_STEP_2B_REF],
|
|
691
|
+
html: `<span id="hidden-export-label" style="display: none;">Export CSV report</span>
|
|
692
|
+
<button type="button" aria-labelledby="hidden-export-label">Download</button>`,
|
|
693
|
+
evaluation: {
|
|
694
|
+
mode: "walk",
|
|
695
|
+
targetRoleHint: "button",
|
|
696
|
+
expectedPhrases: ["Export CSV report"],
|
|
697
|
+
forbiddenPhrases: ["Download"]
|
|
698
|
+
}
|
|
699
|
+
},
|
|
700
|
+
{
|
|
701
|
+
slug: "aria-labelledby-aria-hidden-target",
|
|
702
|
+
title: 'aria-labelledby: References aria-hidden="true" target',
|
|
703
|
+
isolatedTitle: "aria-labelledby aria-hidden target test",
|
|
704
|
+
category: "aria",
|
|
705
|
+
featureGroup: "Accessible Naming",
|
|
706
|
+
attribute: "aria-labelledby",
|
|
707
|
+
tags: ["aria-labelledby", "aria-hidden", "hidden-label", "accname"],
|
|
708
|
+
summary: 'Tests whether a directly referenced element with aria-hidden="true" still computes the accessible name of the referencing control.',
|
|
709
|
+
expectedBehavior: 'The aria-hidden span is excluded from standalone reading, while the button announces "Archive message" instead of "Move".',
|
|
710
|
+
specReferences: [WAI_ARIA_LABELLEDBY_REF, ACCNAME_STEP_2B_REF],
|
|
711
|
+
html: `<span id="aria-hidden-label" aria-hidden="true">Archive message</span>
|
|
712
|
+
<button type="button" aria-labelledby="aria-hidden-label">Move</button>`,
|
|
713
|
+
evaluation: {
|
|
714
|
+
mode: "walk",
|
|
715
|
+
targetRoleHint: "button",
|
|
716
|
+
expectedPhrases: ["Archive message"],
|
|
717
|
+
forbiddenPhrases: ["Move"]
|
|
718
|
+
}
|
|
719
|
+
},
|
|
720
|
+
{
|
|
721
|
+
slug: "aria-labelledby-precedence-over-aria-label",
|
|
722
|
+
title: "aria-labelledby: Precedence over aria-label and label[for]",
|
|
723
|
+
isolatedTitle: "aria-labelledby precedence test",
|
|
724
|
+
category: "aria",
|
|
725
|
+
featureGroup: "Accessible Naming",
|
|
726
|
+
attribute: "aria-labelledby",
|
|
727
|
+
tags: ["aria-labelledby", "aria-label", "label", "precedence", "input"],
|
|
728
|
+
summary: "Tests accessible name source precedence on a native text input that has aria-labelledby, aria-label, and a native <label for> element.",
|
|
729
|
+
expectedBehavior: 'Per AccName 1.2, aria-labelledby wins over both aria-label and native <label>. The text input should be named "Primary email", not "Secondary email" or "Backup email".',
|
|
730
|
+
specReferences: [WAI_ARIA_LABELLEDBY_REF, ACCNAME_PRECEDENCE_REF, HTML_AAM_REF],
|
|
731
|
+
html: `<p id="preferred-label">Primary email</p>
|
|
732
|
+
<label for="email-field">Backup email</label>
|
|
733
|
+
<input id="email-field" type="text" aria-label="Secondary email" aria-labelledby="preferred-label" />`,
|
|
734
|
+
evaluation: {
|
|
735
|
+
mode: "walk",
|
|
736
|
+
targetRoleHint: "text",
|
|
737
|
+
expectedPhrases: ["Primary email"],
|
|
738
|
+
forbiddenPhrases: ["Secondary email"],
|
|
739
|
+
minimumOccurrences: 2
|
|
740
|
+
}
|
|
741
|
+
},
|
|
742
|
+
{
|
|
743
|
+
slug: "aria-labelledby-broken-id-fallback",
|
|
744
|
+
title: "aria-labelledby: Broken ID falls back to inner content",
|
|
745
|
+
isolatedTitle: "aria-labelledby broken ID fallback test",
|
|
746
|
+
category: "aria",
|
|
747
|
+
featureGroup: "Accessible Naming",
|
|
748
|
+
attribute: "aria-labelledby",
|
|
749
|
+
tags: ["aria-labelledby", "fallback", "missing-id", "button"],
|
|
750
|
+
summary: "Tests fallback behavior when aria-labelledby references an ID that does not exist in the document.",
|
|
751
|
+
expectedBehavior: 'Because #does-not-exist resolves to nothing, Step 2B returns empty and accessible name computation falls back to the button text: "Save draft".',
|
|
752
|
+
specReferences: [WAI_ARIA_LABELLEDBY_REF, ACCNAME_PRECEDENCE_REF],
|
|
753
|
+
html: `<button type="button" aria-labelledby="does-not-exist">Save draft</button>`,
|
|
754
|
+
evaluation: {
|
|
755
|
+
mode: "walk",
|
|
756
|
+
targetRoleHint: "button",
|
|
757
|
+
expectedPhrases: ["Save draft"]
|
|
758
|
+
}
|
|
759
|
+
},
|
|
760
|
+
{
|
|
761
|
+
slug: "aria-labelledby-chained-no-recursion",
|
|
762
|
+
title: "aria-labelledby: Chained references do not recurse",
|
|
763
|
+
isolatedTitle: "aria-labelledby chained no recursion test",
|
|
764
|
+
category: "aria",
|
|
765
|
+
featureGroup: "Accessible Naming",
|
|
766
|
+
attribute: "aria-labelledby",
|
|
767
|
+
tags: ["aria-labelledby", "recursion", "chained", "accname"],
|
|
768
|
+
summary: "Tests AccName 1.2 Step 2B rule prohibiting recursive traversal of aria-labelledby on an already-referenced element.",
|
|
769
|
+
expectedBehavior: 'The button references #parent-label, which itself has aria-labelledby="grandparent-label". The button name MUST use #parent-label subtree text ("Parent text") and MUST NOT follow the chain to "Grandparent label".',
|
|
770
|
+
specReferences: [WAI_ARIA_LABELLEDBY_REF, ACCNAME_STEP_2B_REF],
|
|
771
|
+
html: `<span id="grandparent-label">Grandparent label</span>
|
|
772
|
+
<span id="parent-label" aria-labelledby="grandparent-label">Parent text</span>
|
|
773
|
+
<button type="button" aria-labelledby="parent-label">Original button</button>`,
|
|
774
|
+
evaluation: {
|
|
775
|
+
mode: "walk",
|
|
776
|
+
targetRoleHint: "button",
|
|
777
|
+
expectedPhrases: ["Parent text"],
|
|
778
|
+
forbiddenPhrases: ["Grandparent label", "Original button"]
|
|
779
|
+
}
|
|
780
|
+
},
|
|
781
|
+
{
|
|
782
|
+
slug: "aria-labelledby-prohibited-generic-div",
|
|
783
|
+
title: "aria-labelledby: Ignored on generic div (naming prohibited)",
|
|
784
|
+
isolatedTitle: "aria-labelledby prohibited on generic div test",
|
|
785
|
+
category: "aria",
|
|
786
|
+
featureGroup: "Accessible Naming",
|
|
787
|
+
attribute: "aria-labelledby",
|
|
788
|
+
tags: ["aria-labelledby", "generic", "div", "name-prohibited"],
|
|
789
|
+
summary: "Tests whether screen readers honor WAI-ARIA 1.2 prohibition against naming generic containers (<div> with no role) via aria-labelledby.",
|
|
790
|
+
expectedBehavior: 'Because the generic role prohibits accessible naming from author, the <div> should read its text content "Visible paragraph text" rather than replacing it with "Special announcement".',
|
|
791
|
+
specReferences: [WAI_ARIA_LABELLEDBY_REF, NAME_PROHIBITED_REF2],
|
|
792
|
+
html: `<span id="override-label">Special announcement</span>
|
|
793
|
+
<div aria-labelledby="override-label">Visible paragraph text</div>`,
|
|
794
|
+
evaluation: {
|
|
795
|
+
mode: "walk",
|
|
796
|
+
expectedPhrases: ["Visible paragraph text"],
|
|
797
|
+
maxPhraseOccurrences: {
|
|
798
|
+
"Special announcement": 1
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
];
|
|
803
|
+
|
|
804
|
+
// src/cases/aria-live.ts
|
|
805
|
+
var ARIA_LIVE_REF = {
|
|
806
|
+
title: "WAI-ARIA 1.2: aria-live property",
|
|
807
|
+
url: "https://www.w3.org/TR/wai-aria-1.2/#aria-live",
|
|
808
|
+
section: "6.6.2 aria-live"
|
|
809
|
+
};
|
|
810
|
+
var ariaLiveCases = [
|
|
811
|
+
{
|
|
812
|
+
slug: "aria-live-polite-update",
|
|
813
|
+
title: "aria-live: Announces polite live region update after button click",
|
|
814
|
+
isolatedTitle: "aria-live polite update test",
|
|
815
|
+
category: "aria",
|
|
816
|
+
featureGroup: "Live Regions",
|
|
817
|
+
attribute: "aria-live",
|
|
818
|
+
tags: ["aria-live", "polite", "live-region", "dynamic"],
|
|
819
|
+
summary: 'Tests whether dynamically inserting text into an aria-live="polite" container after activating a button triggers a screen reader announcement.',
|
|
820
|
+
expectedBehavior: 'After activating "Save settings", the screen reader should announce "Preferences saved" without moving focus.',
|
|
821
|
+
specReferences: [ARIA_LIVE_REF],
|
|
822
|
+
html: `<button type="button" id="trigger-polite">Save settings</button>
|
|
823
|
+
<div id="polite-status" aria-live="polite"></div>`,
|
|
824
|
+
js: `const trigger = document.getElementById('trigger-polite');
|
|
825
|
+
const status = document.getElementById('polite-status');
|
|
826
|
+
trigger?.addEventListener('click', () => {
|
|
827
|
+
if (status) {
|
|
828
|
+
status.textContent = 'Preferences saved';
|
|
829
|
+
}
|
|
830
|
+
});`,
|
|
831
|
+
evaluation: {
|
|
832
|
+
mode: "interact",
|
|
833
|
+
targetRoleHint: "button",
|
|
834
|
+
activateButtonText: "Save settings",
|
|
835
|
+
preActionExpectedPhrases: ["Save settings"],
|
|
836
|
+
expectedPhrases: ["Preferences saved"]
|
|
837
|
+
}
|
|
838
|
+
},
|
|
839
|
+
{
|
|
840
|
+
slug: "aria-live-assertive-update",
|
|
841
|
+
title: "aria-live: Announces assertive live region update",
|
|
842
|
+
isolatedTitle: "aria-live assertive update test",
|
|
843
|
+
category: "aria",
|
|
844
|
+
featureGroup: "Live Regions",
|
|
845
|
+
attribute: "aria-live",
|
|
846
|
+
tags: ["aria-live", "assertive", "live-region", "dynamic"],
|
|
847
|
+
summary: 'Tests whether updating an aria-live="assertive" region dynamically after button activation produces an announcement.',
|
|
848
|
+
expectedBehavior: 'After activating "Validate token", the screen reader should announce "Session expired" from the assertive live region.',
|
|
849
|
+
specReferences: [ARIA_LIVE_REF],
|
|
850
|
+
html: `<button type="button" id="trigger-assertive">Validate token</button>
|
|
851
|
+
<div id="assertive-status" aria-live="assertive"></div>`,
|
|
852
|
+
js: `const trigger = document.getElementById('trigger-assertive');
|
|
853
|
+
const status = document.getElementById('assertive-status');
|
|
854
|
+
trigger?.addEventListener('click', () => {
|
|
855
|
+
if (status) {
|
|
856
|
+
status.textContent = 'Session expired';
|
|
857
|
+
}
|
|
858
|
+
});`,
|
|
859
|
+
evaluation: {
|
|
860
|
+
mode: "interact",
|
|
861
|
+
targetRoleHint: "button",
|
|
862
|
+
activateButtonText: "Validate token",
|
|
863
|
+
preActionExpectedPhrases: ["Validate token"],
|
|
864
|
+
expectedPhrases: ["Session expired"]
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
];
|
|
868
|
+
|
|
869
|
+
// src/cases/role-alert.ts
|
|
870
|
+
var ARIA_ALERT_REF = {
|
|
871
|
+
title: "WAI-ARIA 1.2: alert (role)",
|
|
872
|
+
url: "https://www.w3.org/TR/wai-aria-1.2/#alert",
|
|
873
|
+
section: "5.3.2 Live Region Roles - alert"
|
|
874
|
+
};
|
|
875
|
+
var APG_ALERT_REF = {
|
|
876
|
+
title: "ARIA Authoring Practices Guide: Alert Pattern",
|
|
877
|
+
url: "https://www.w3.org/WAI/ARIA/apg/patterns/alert/",
|
|
878
|
+
section: "Alert Example"
|
|
879
|
+
};
|
|
880
|
+
var roleAlertCases = [
|
|
881
|
+
{
|
|
882
|
+
slug: "role-alert-dynamic",
|
|
883
|
+
title: 'role="alert": Announces dynamically triggered alert message',
|
|
884
|
+
isolatedTitle: "role alert dynamic test",
|
|
885
|
+
category: "aria",
|
|
886
|
+
featureGroup: "Live Regions",
|
|
887
|
+
attribute: "alert",
|
|
888
|
+
tags: ["alert", "role", "live-region", "dynamic", "aria-at"],
|
|
889
|
+
summary: 'Tests whether triggering content inside a role="alert" container announces the alert message promptly without moving focus.',
|
|
890
|
+
expectedBehavior: 'Initially the "Trigger alert" button announces as a button; after activation, the screen reader MUST convey the alert text "Hello" and MAY convey the "alert" role.',
|
|
891
|
+
specReferences: [ARIA_ALERT_REF, APG_ALERT_REF],
|
|
892
|
+
html: `<button type="button" id="trigger-alert">Trigger alert</button>
|
|
893
|
+
<div id="alert-region" role="alert"></div>`,
|
|
894
|
+
js: `const triggerBtn = document.getElementById('trigger-alert');
|
|
895
|
+
const alertRegion = document.getElementById('alert-region');
|
|
896
|
+
triggerBtn?.addEventListener('click', () => {
|
|
897
|
+
if (alertRegion) {
|
|
898
|
+
alertRegion.textContent = 'Hello';
|
|
899
|
+
}
|
|
900
|
+
});`,
|
|
901
|
+
evaluation: {
|
|
902
|
+
mode: "interact",
|
|
903
|
+
targetRoleHint: "button",
|
|
904
|
+
activateButtonText: "Trigger alert",
|
|
905
|
+
preActionExpectedPhrases: ["Trigger alert"],
|
|
906
|
+
expectedPhrases: ["Hello"]
|
|
907
|
+
},
|
|
908
|
+
assertions: [
|
|
909
|
+
{
|
|
910
|
+
id: "alert-pre-button",
|
|
911
|
+
priority: "MUST",
|
|
912
|
+
statement: 'Convey initial control label "Trigger alert" before activation',
|
|
913
|
+
featureRef: "button",
|
|
914
|
+
rule: {
|
|
915
|
+
kind: "convey-phrase",
|
|
916
|
+
phrase: "Trigger alert",
|
|
917
|
+
scope: "pre-action"
|
|
918
|
+
}
|
|
919
|
+
},
|
|
920
|
+
{
|
|
921
|
+
id: "alert-post-text",
|
|
922
|
+
priority: "MUST",
|
|
923
|
+
statement: 'Convey alert text "Hello" after activating the trigger button',
|
|
924
|
+
featureRef: "alert",
|
|
925
|
+
rule: {
|
|
926
|
+
kind: "convey-phrase",
|
|
927
|
+
phrase: "Hello",
|
|
928
|
+
scope: "post-action"
|
|
929
|
+
}
|
|
930
|
+
},
|
|
931
|
+
{
|
|
932
|
+
id: "alert-post-role",
|
|
933
|
+
priority: "MAY",
|
|
934
|
+
statement: 'Convey role "alert" when the alert region updates',
|
|
935
|
+
featureRef: "alert",
|
|
936
|
+
rule: {
|
|
937
|
+
kind: "convey-phrase",
|
|
938
|
+
phrase: "alert",
|
|
939
|
+
scope: "post-action"
|
|
940
|
+
}
|
|
941
|
+
},
|
|
942
|
+
{
|
|
943
|
+
id: "alert-no-side-effects",
|
|
944
|
+
priority: "MUST",
|
|
945
|
+
statement: "Cause no severe negative side effects",
|
|
946
|
+
featureRef: "alert",
|
|
947
|
+
rule: {
|
|
948
|
+
kind: "no-side-effects"
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
]
|
|
952
|
+
}
|
|
953
|
+
];
|
|
954
|
+
|
|
955
|
+
// src/cases/index.ts
|
|
956
|
+
var screenReaderTests = [
|
|
957
|
+
...ariaLabelledbyCases,
|
|
958
|
+
...ariaLabelCases,
|
|
959
|
+
...ariaDescribedbyCases,
|
|
960
|
+
...ariaHiddenCases,
|
|
961
|
+
...ariaExpandedCases,
|
|
962
|
+
...ariaDisabledCases,
|
|
963
|
+
...ariaCurrentCases,
|
|
964
|
+
...ariaLiveCases,
|
|
965
|
+
...roleAlertCases
|
|
966
|
+
];
|
|
967
|
+
function assertUniqueSlugs(cases) {
|
|
968
|
+
const seen = /* @__PURE__ */ new Set();
|
|
969
|
+
for (const testCase of cases) {
|
|
970
|
+
if (seen.has(testCase.slug)) {
|
|
971
|
+
throw new Error(`Duplicate screen reader test slug: "${testCase.slug}".`);
|
|
972
|
+
}
|
|
973
|
+
seen.add(testCase.slug);
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
assertUniqueSlugs(screenReaderTests);
|
|
977
|
+
function listTestCases() {
|
|
978
|
+
return screenReaderTests;
|
|
979
|
+
}
|
|
980
|
+
function getTestCaseBySlug(slug) {
|
|
981
|
+
return screenReaderTests.find((testCase) => testCase.slug === slug);
|
|
982
|
+
}
|
|
983
|
+
function listAttributes() {
|
|
984
|
+
const unique = new Set(screenReaderTests.map((testCase) => testCase.attribute));
|
|
985
|
+
return [...unique];
|
|
986
|
+
}
|
|
987
|
+
function listCategories() {
|
|
988
|
+
const unique = new Set(screenReaderTests.map((testCase) => testCase.category));
|
|
989
|
+
return [...unique];
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
// src/results/index.ts
|
|
993
|
+
import { existsSync as existsSync3, readdirSync as readdirSync2, readFileSync as readFileSync2 } from "fs";
|
|
994
|
+
import { resolve as resolve3 } from "path";
|
|
995
|
+
function isRecord2(value) {
|
|
996
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
997
|
+
}
|
|
998
|
+
function isEnvironmentResultFile(value) {
|
|
999
|
+
if (!isRecord2(value)) {
|
|
1000
|
+
return false;
|
|
1001
|
+
}
|
|
1002
|
+
return value.schemaVersion === 1 && typeof value.environmentKey === "string" && isRecord2(value.environment) && typeof value.environment.id === "string" && (value.status === "tested" || value.status === "untested") && Array.isArray(value.runs);
|
|
1003
|
+
}
|
|
1004
|
+
var DEFAULT_USAGE_ORDER = 99;
|
|
1005
|
+
var PLATFORM_ORDER = {
|
|
1006
|
+
"macos-voiceover": 0,
|
|
1007
|
+
"android-talkback": 1,
|
|
1008
|
+
"ios-voiceover": 2,
|
|
1009
|
+
virtual: 3
|
|
1010
|
+
};
|
|
1011
|
+
var cacheState2 = {
|
|
1012
|
+
environmentFiles: void 0
|
|
1013
|
+
};
|
|
1014
|
+
function resetResultsCache() {
|
|
1015
|
+
cacheState2.environmentFiles = void 0;
|
|
1016
|
+
}
|
|
1017
|
+
function loadEnvironmentFiles() {
|
|
1018
|
+
const { resultsDir } = getSupportDataDirectories();
|
|
1019
|
+
if (!existsSync3(resultsDir)) {
|
|
1020
|
+
return [];
|
|
1021
|
+
}
|
|
1022
|
+
const loaded = [];
|
|
1023
|
+
const fileNames = readdirSync2(resultsDir).filter((name) => name.endsWith(".json"));
|
|
1024
|
+
for (const fileName of fileNames) {
|
|
1025
|
+
const filePath = resolve3(resultsDir, fileName);
|
|
1026
|
+
const parsed = JSON.parse(readFileSync2(filePath, "utf8"));
|
|
1027
|
+
if (!isEnvironmentResultFile(parsed)) {
|
|
1028
|
+
throw new Error(`Invalid screen reader result file: ${filePath}`);
|
|
1029
|
+
}
|
|
1030
|
+
loaded.push(parsed);
|
|
1031
|
+
}
|
|
1032
|
+
return loaded.toSorted((left, right) => {
|
|
1033
|
+
const groupDiff = PLATFORM_ORDER[left.environment.platformGroup] - PLATFORM_ORDER[right.environment.platformGroup];
|
|
1034
|
+
if (groupDiff !== 0) {
|
|
1035
|
+
return groupDiff;
|
|
1036
|
+
}
|
|
1037
|
+
const orderDiff = (left.environment.usageOrder ?? DEFAULT_USAGE_ORDER) - (right.environment.usageOrder ?? DEFAULT_USAGE_ORDER);
|
|
1038
|
+
if (orderDiff !== 0) {
|
|
1039
|
+
return orderDiff;
|
|
1040
|
+
}
|
|
1041
|
+
return left.environment.label.localeCompare(right.environment.label);
|
|
1042
|
+
});
|
|
1043
|
+
}
|
|
1044
|
+
function listEnvironmentFiles() {
|
|
1045
|
+
cacheState2.environmentFiles ??= loadEnvironmentFiles();
|
|
1046
|
+
return cacheState2.environmentFiles;
|
|
1047
|
+
}
|
|
1048
|
+
function listEnvironments() {
|
|
1049
|
+
return listEnvironmentFiles().map((file) => file.environment);
|
|
1050
|
+
}
|
|
1051
|
+
function getRunForTestAndEnvironment(testSlug, environmentKey) {
|
|
1052
|
+
const envFile = listEnvironmentFiles().find(
|
|
1053
|
+
(file) => file.environmentKey === environmentKey
|
|
1054
|
+
);
|
|
1055
|
+
if (!envFile) {
|
|
1056
|
+
return void 0;
|
|
1057
|
+
}
|
|
1058
|
+
return envFile.runs.find((run) => run.testSlug === testSlug);
|
|
1059
|
+
}
|
|
1060
|
+
function getRunsForTest(testSlug) {
|
|
1061
|
+
const runs = [];
|
|
1062
|
+
for (const envFile of listEnvironmentFiles()) {
|
|
1063
|
+
const match = envFile.runs.find((run) => run.testSlug === testSlug);
|
|
1064
|
+
if (match) {
|
|
1065
|
+
runs.push(match);
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
return runs;
|
|
1069
|
+
}
|
|
1070
|
+
function getSummaryCounts() {
|
|
1071
|
+
const files = listEnvironmentFiles();
|
|
1072
|
+
const counts = {
|
|
1073
|
+
pass: 0,
|
|
1074
|
+
partial: 0,
|
|
1075
|
+
fail: 0,
|
|
1076
|
+
"not-applicable": 0,
|
|
1077
|
+
untested: 0
|
|
1078
|
+
};
|
|
1079
|
+
let testedEnvironments = 0;
|
|
1080
|
+
let totalRuns = 0;
|
|
1081
|
+
for (const file of files) {
|
|
1082
|
+
if (file.status === "tested" && file.runs.length > 0) {
|
|
1083
|
+
testedEnvironments += 1;
|
|
1084
|
+
}
|
|
1085
|
+
for (const run of file.runs) {
|
|
1086
|
+
counts[run.outcome] += 1;
|
|
1087
|
+
totalRuns += 1;
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
return {
|
|
1091
|
+
...counts,
|
|
1092
|
+
totalRuns,
|
|
1093
|
+
testedEnvironments,
|
|
1094
|
+
trackedEnvironments: files.length
|
|
1095
|
+
};
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
// src/features.ts
|
|
1099
|
+
var COVERAGE_SORT_ORDER = {
|
|
1100
|
+
both: 0,
|
|
1101
|
+
local: 1,
|
|
1102
|
+
"w3c-aria-at": 2
|
|
1103
|
+
};
|
|
1104
|
+
var EMPTY_SUMMARY = {
|
|
1105
|
+
must: createEmptyPriorityCounts(),
|
|
1106
|
+
should: createEmptyPriorityCounts(),
|
|
1107
|
+
may: createEmptyPriorityCounts(),
|
|
1108
|
+
severeSideEffects: 0,
|
|
1109
|
+
moderateSideEffects: 0
|
|
1110
|
+
};
|
|
1111
|
+
function matchesFeatureAssertion(assertion, type, refId) {
|
|
1112
|
+
if (assertion.featureRefs && assertion.featureRefs.length > 0) {
|
|
1113
|
+
return assertion.featureRefs.some(
|
|
1114
|
+
(ref) => ref.type === type && ref.refId === refId
|
|
1115
|
+
);
|
|
1116
|
+
}
|
|
1117
|
+
return assertion.featureType === type && assertion.featureRef === refId;
|
|
1118
|
+
}
|
|
1119
|
+
function buildLocalEnvironmentResult(envFile, runs) {
|
|
1120
|
+
const env = envFile.environment;
|
|
1121
|
+
const allAssertions = [];
|
|
1122
|
+
const items = [];
|
|
1123
|
+
let latestRunAt = void 0;
|
|
1124
|
+
for (const item of runs) {
|
|
1125
|
+
const assertions = item.assertionResults ?? [];
|
|
1126
|
+
const summary = item.assertionSummary ?? summarizeAssertions(assertions);
|
|
1127
|
+
allAssertions.push(...assertions);
|
|
1128
|
+
if (!latestRunAt || item.runAt > latestRunAt) {
|
|
1129
|
+
latestRunAt = item.runAt;
|
|
1130
|
+
}
|
|
1131
|
+
items.push({
|
|
1132
|
+
kind: "local",
|
|
1133
|
+
testSlug: item.testCase.slug,
|
|
1134
|
+
testTitle: item.testCase.title,
|
|
1135
|
+
outcome: item.outcome,
|
|
1136
|
+
keyAnnouncement: item.keyAnnouncement,
|
|
1137
|
+
notes: item.notes,
|
|
1138
|
+
summary,
|
|
1139
|
+
assertions,
|
|
1140
|
+
transcript: item.transcript,
|
|
1141
|
+
driver: item.driver,
|
|
1142
|
+
runAt: item.runAt
|
|
1143
|
+
});
|
|
1144
|
+
}
|
|
1145
|
+
return {
|
|
1146
|
+
source: "local",
|
|
1147
|
+
environmentKey: envFile.environmentKey,
|
|
1148
|
+
environmentID: env.id,
|
|
1149
|
+
screenReader: env.screenReader,
|
|
1150
|
+
screenReaderVersion: env.screenReaderVersion,
|
|
1151
|
+
browser: env.browser,
|
|
1152
|
+
browserVersion: env.browserVersion,
|
|
1153
|
+
browserType: env.browserType === "webview" ? "webview" : "browser",
|
|
1154
|
+
os: env.os,
|
|
1155
|
+
osVersion: env.osVersion,
|
|
1156
|
+
device: env.device,
|
|
1157
|
+
...latestRunAt ? { testedAt: latestRunAt } : {},
|
|
1158
|
+
status: envFile.status,
|
|
1159
|
+
...envFile.statusNote ? { statusNote: envFile.statusNote } : {},
|
|
1160
|
+
summary: runs.length > 0 ? summarizeAssertions(allAssertions) : EMPTY_SUMMARY,
|
|
1161
|
+
items
|
|
1162
|
+
};
|
|
1163
|
+
}
|
|
1164
|
+
function buildAriaAtEnvKey(report) {
|
|
1165
|
+
return [
|
|
1166
|
+
report.device,
|
|
1167
|
+
report.os,
|
|
1168
|
+
report.osVersion,
|
|
1169
|
+
report.browserName,
|
|
1170
|
+
report.browserVersion,
|
|
1171
|
+
report.atName,
|
|
1172
|
+
report.atVersion
|
|
1173
|
+
].join(" | ");
|
|
1174
|
+
}
|
|
1175
|
+
function ensureFeatureMetadata(metaMap, descriptor) {
|
|
1176
|
+
const key = `${descriptor.type}:${descriptor.refId}`;
|
|
1177
|
+
let entry = metaMap.get(key);
|
|
1178
|
+
if (!entry) {
|
|
1179
|
+
entry = {
|
|
1180
|
+
type: descriptor.type,
|
|
1181
|
+
refId: descriptor.refId,
|
|
1182
|
+
linkText: descriptor.linkText,
|
|
1183
|
+
specURL: descriptor.specURL,
|
|
1184
|
+
localCases: [],
|
|
1185
|
+
planMap: /* @__PURE__ */ new Map()
|
|
1186
|
+
};
|
|
1187
|
+
metaMap.set(key, entry);
|
|
1188
|
+
return entry;
|
|
1189
|
+
}
|
|
1190
|
+
if (!entry.specURL && descriptor.specURL) {
|
|
1191
|
+
entry.specURL = descriptor.specURL;
|
|
1192
|
+
}
|
|
1193
|
+
if (entry.linkText === descriptor.refId && descriptor.linkText) {
|
|
1194
|
+
entry.linkText = descriptor.linkText;
|
|
1195
|
+
}
|
|
1196
|
+
return entry;
|
|
1197
|
+
}
|
|
1198
|
+
function collectFeatureMetadata() {
|
|
1199
|
+
const summaryFile = getAriaAtSummary();
|
|
1200
|
+
const plans = listAriaAtPlans();
|
|
1201
|
+
const metaMap = /* @__PURE__ */ new Map();
|
|
1202
|
+
for (const feat of summaryFile.features) {
|
|
1203
|
+
ensureFeatureMetadata(metaMap, feat);
|
|
1204
|
+
}
|
|
1205
|
+
for (const plan of plans) {
|
|
1206
|
+
for (const ref of plan.featureRefs) {
|
|
1207
|
+
const entry = ensureFeatureMetadata(metaMap, ref);
|
|
1208
|
+
entry.planMap.set(plan.slug, plan);
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1211
|
+
for (const testCase of screenReaderTests) {
|
|
1212
|
+
const specURL = testCase.specReferences[0]?.url ?? "";
|
|
1213
|
+
const entry = ensureFeatureMetadata(metaMap, {
|
|
1214
|
+
type: testCase.category,
|
|
1215
|
+
refId: testCase.attribute,
|
|
1216
|
+
linkText: `${testCase.attribute} Specification`,
|
|
1217
|
+
specURL
|
|
1218
|
+
});
|
|
1219
|
+
entry.localCases.push(testCase);
|
|
1220
|
+
}
|
|
1221
|
+
return metaMap;
|
|
1222
|
+
}
|
|
1223
|
+
function appendLocalEnvsForFeature(localCases, envFiles, versionedEnvs) {
|
|
1224
|
+
if (localCases.length === 0) {
|
|
1225
|
+
return;
|
|
1226
|
+
}
|
|
1227
|
+
const caseBySlug = new Map(localCases.map((testCase) => [testCase.slug, testCase]));
|
|
1228
|
+
for (const envFile of envFiles) {
|
|
1229
|
+
const matchedRuns = [];
|
|
1230
|
+
for (const run of envFile.runs) {
|
|
1231
|
+
const testCase = caseBySlug.get(run.testSlug);
|
|
1232
|
+
if (!testCase) {
|
|
1233
|
+
continue;
|
|
1234
|
+
}
|
|
1235
|
+
matchedRuns.push({
|
|
1236
|
+
testCase,
|
|
1237
|
+
runAt: run.runAt,
|
|
1238
|
+
driver: run.driver,
|
|
1239
|
+
outcome: run.outcome,
|
|
1240
|
+
keyAnnouncement: run.keyAnnouncement,
|
|
1241
|
+
notes: run.notes,
|
|
1242
|
+
transcript: run.transcript,
|
|
1243
|
+
...run.assertionResults ? { assertionResults: run.assertionResults } : {},
|
|
1244
|
+
...run.assertionSummary ? { assertionSummary: run.assertionSummary } : {}
|
|
1245
|
+
});
|
|
1246
|
+
}
|
|
1247
|
+
versionedEnvs.push(buildLocalEnvironmentResult(envFile, matchedRuns));
|
|
1248
|
+
}
|
|
1249
|
+
}
|
|
1250
|
+
function extractMatchingTestCommands(report, type, refId) {
|
|
1251
|
+
const matchingTests = [];
|
|
1252
|
+
const repAssertions = [];
|
|
1253
|
+
const repSideEffects = [];
|
|
1254
|
+
for (const testItem of report.tests) {
|
|
1255
|
+
const filteredCmds = [];
|
|
1256
|
+
for (const cmdRes of testItem.commandResults) {
|
|
1257
|
+
const matchingAssertions = cmdRes.assertions.filter(
|
|
1258
|
+
(assertion) => matchesFeatureAssertion(assertion, type, refId)
|
|
1259
|
+
);
|
|
1260
|
+
if (matchingAssertions.length > 0) {
|
|
1261
|
+
repAssertions.push(...matchingAssertions);
|
|
1262
|
+
repSideEffects.push(...cmdRes.negativeSideEffects);
|
|
1263
|
+
filteredCmds.push({
|
|
1264
|
+
commands: cmdRes.commands,
|
|
1265
|
+
output: cmdRes.output,
|
|
1266
|
+
untestable: cmdRes.untestable,
|
|
1267
|
+
assertions: matchingAssertions,
|
|
1268
|
+
negativeSideEffects: cmdRes.negativeSideEffects
|
|
1269
|
+
});
|
|
1270
|
+
}
|
|
1271
|
+
}
|
|
1272
|
+
if (filteredCmds.length > 0) {
|
|
1273
|
+
matchingTests.push({
|
|
1274
|
+
testTitle: testItem.testTitle,
|
|
1275
|
+
commandResults: filteredCmds
|
|
1276
|
+
});
|
|
1277
|
+
}
|
|
1278
|
+
}
|
|
1279
|
+
return { matchingTests, repAssertions, repSideEffects };
|
|
1280
|
+
}
|
|
1281
|
+
function mergePlanReportIntoGrouped({
|
|
1282
|
+
plan,
|
|
1283
|
+
report,
|
|
1284
|
+
meta,
|
|
1285
|
+
grouped
|
|
1286
|
+
}) {
|
|
1287
|
+
const extracted = extractMatchingTestCommands(report, meta.type, meta.refId);
|
|
1288
|
+
if (extracted.matchingTests.length === 0) {
|
|
1289
|
+
return;
|
|
1290
|
+
}
|
|
1291
|
+
const envKey = buildAriaAtEnvKey(report);
|
|
1292
|
+
let group = grouped.get(envKey);
|
|
1293
|
+
if (!group) {
|
|
1294
|
+
group = {
|
|
1295
|
+
report,
|
|
1296
|
+
assertions: [],
|
|
1297
|
+
sideEffects: [],
|
|
1298
|
+
items: [],
|
|
1299
|
+
...report.markedFinalAt ? { latestAt: report.markedFinalAt } : {}
|
|
1300
|
+
};
|
|
1301
|
+
grouped.set(envKey, group);
|
|
1302
|
+
}
|
|
1303
|
+
if (report.markedFinalAt && (!group.latestAt || report.markedFinalAt > group.latestAt)) {
|
|
1304
|
+
group.latestAt = report.markedFinalAt;
|
|
1305
|
+
}
|
|
1306
|
+
group.assertions.push(...extracted.repAssertions);
|
|
1307
|
+
group.sideEffects.push(...extracted.repSideEffects);
|
|
1308
|
+
for (const matchTest of extracted.matchingTests) {
|
|
1309
|
+
group.items.push({
|
|
1310
|
+
kind: "w3c-aria-at",
|
|
1311
|
+
planSlug: plan.slug,
|
|
1312
|
+
planTitle: plan.title,
|
|
1313
|
+
planVersionString: plan.versionString,
|
|
1314
|
+
planPhase: plan.phase,
|
|
1315
|
+
reportID: report.reportID,
|
|
1316
|
+
upstreamReportURL: `https://aria-at.w3.org/report/${plan.planVersionID}/targets/${report.reportID}`,
|
|
1317
|
+
testTitle: matchTest.testTitle,
|
|
1318
|
+
commandResults: matchTest.commandResults
|
|
1319
|
+
});
|
|
1320
|
+
}
|
|
1321
|
+
}
|
|
1322
|
+
function collectAriaAtGroupsForFeature(meta) {
|
|
1323
|
+
const grouped = /* @__PURE__ */ new Map();
|
|
1324
|
+
for (const plan of meta.planMap.values()) {
|
|
1325
|
+
for (const report of plan.reports) {
|
|
1326
|
+
mergePlanReportIntoGrouped({ plan, report, meta, grouped });
|
|
1327
|
+
}
|
|
1328
|
+
}
|
|
1329
|
+
return grouped;
|
|
1330
|
+
}
|
|
1331
|
+
function appendAriaAtEnvsFromGroups(grouped, versionedEnvs) {
|
|
1332
|
+
for (const [envKey, group] of grouped.entries()) {
|
|
1333
|
+
const rep = group.report;
|
|
1334
|
+
versionedEnvs.push({
|
|
1335
|
+
source: "w3c-aria-at",
|
|
1336
|
+
environmentKey: envKey,
|
|
1337
|
+
environmentID: `aria-at-${rep.atKey}-${rep.browserKey}-${rep.reportID}`,
|
|
1338
|
+
screenReader: rep.atName,
|
|
1339
|
+
screenReaderVersion: rep.atVersion,
|
|
1340
|
+
browser: rep.browserName,
|
|
1341
|
+
browserVersion: rep.browserVersion,
|
|
1342
|
+
browserType: "browser",
|
|
1343
|
+
os: rep.os,
|
|
1344
|
+
osVersion: rep.osVersion,
|
|
1345
|
+
device: rep.device,
|
|
1346
|
+
...group.latestAt ? { testedAt: group.latestAt } : {},
|
|
1347
|
+
status: "tested",
|
|
1348
|
+
summary: summarizeAssertions(group.assertions, group.sideEffects),
|
|
1349
|
+
items: group.items
|
|
1350
|
+
});
|
|
1351
|
+
}
|
|
1352
|
+
}
|
|
1353
|
+
function resolveCoverage(localCases, ariaAtPlans) {
|
|
1354
|
+
if (localCases.length > 0 && ariaAtPlans.length > 0) {
|
|
1355
|
+
return "both";
|
|
1356
|
+
}
|
|
1357
|
+
if (localCases.length > 0) {
|
|
1358
|
+
return "local";
|
|
1359
|
+
}
|
|
1360
|
+
return "w3c-aria-at";
|
|
1361
|
+
}
|
|
1362
|
+
function compareFeatureReports(left, right) {
|
|
1363
|
+
if (left.sourceCoverage !== right.sourceCoverage) {
|
|
1364
|
+
return COVERAGE_SORT_ORDER[left.sourceCoverage] - COVERAGE_SORT_ORDER[right.sourceCoverage];
|
|
1365
|
+
}
|
|
1366
|
+
if (left.type !== right.type) {
|
|
1367
|
+
return left.type.localeCompare(right.type);
|
|
1368
|
+
}
|
|
1369
|
+
return left.refId.localeCompare(right.refId);
|
|
1370
|
+
}
|
|
1371
|
+
function buildFeaturesCatalog() {
|
|
1372
|
+
const metaMap = collectFeatureMetadata();
|
|
1373
|
+
const envFiles = listEnvironmentFiles();
|
|
1374
|
+
const results = [];
|
|
1375
|
+
for (const [key, meta] of metaMap.entries()) {
|
|
1376
|
+
const versionedEnvs = [];
|
|
1377
|
+
appendLocalEnvsForFeature(meta.localCases, envFiles, versionedEnvs);
|
|
1378
|
+
const ariaAtGrouped = collectAriaAtGroupsForFeature(meta);
|
|
1379
|
+
appendAriaAtEnvsFromGroups(ariaAtGrouped, versionedEnvs);
|
|
1380
|
+
const localEnvsCount = versionedEnvs.filter(
|
|
1381
|
+
(item) => item.source === "local" && item.status === "tested"
|
|
1382
|
+
).length;
|
|
1383
|
+
const ariaAtEnvsCount = versionedEnvs.filter(
|
|
1384
|
+
(item) => item.source === "w3c-aria-at"
|
|
1385
|
+
).length;
|
|
1386
|
+
const ariaAtPlans = [...meta.planMap.values()].toSorted(
|
|
1387
|
+
(left, right) => left.title.localeCompare(right.title)
|
|
1388
|
+
);
|
|
1389
|
+
results.push({
|
|
1390
|
+
key,
|
|
1391
|
+
type: meta.type,
|
|
1392
|
+
refId: meta.refId,
|
|
1393
|
+
title: meta.refId,
|
|
1394
|
+
linkText: meta.linkText,
|
|
1395
|
+
specURL: meta.specURL,
|
|
1396
|
+
sourceCoverage: resolveCoverage(meta.localCases, ariaAtPlans),
|
|
1397
|
+
localCases: meta.localCases,
|
|
1398
|
+
ariaAtPlans,
|
|
1399
|
+
versionedEnvironments: versionedEnvs,
|
|
1400
|
+
testedEnvironmentCount: localEnvsCount + ariaAtEnvsCount,
|
|
1401
|
+
localEnvironmentCount: localEnvsCount,
|
|
1402
|
+
ariaAtEnvironmentCount: ariaAtEnvsCount
|
|
1403
|
+
});
|
|
1404
|
+
}
|
|
1405
|
+
return results.toSorted(compareFeatureReports);
|
|
1406
|
+
}
|
|
1407
|
+
var cacheState3 = {
|
|
1408
|
+
features: void 0
|
|
1409
|
+
};
|
|
1410
|
+
function resetFeaturesCache() {
|
|
1411
|
+
cacheState3.features = void 0;
|
|
1412
|
+
}
|
|
1413
|
+
function listFeatures() {
|
|
1414
|
+
cacheState3.features ??= buildFeaturesCatalog();
|
|
1415
|
+
return cacheState3.features;
|
|
1416
|
+
}
|
|
1417
|
+
function getFeatureReport(type, refId) {
|
|
1418
|
+
return listFeatures().find(
|
|
1419
|
+
(feature) => feature.type === type && feature.refId === refId
|
|
1420
|
+
);
|
|
1421
|
+
}
|
|
1422
|
+
function listFeatureSummaryForTestAttribute(attribute) {
|
|
1423
|
+
return listFeatures().find((feature) => feature.refId === attribute);
|
|
1424
|
+
}
|
|
1425
|
+
|
|
1426
|
+
// src/assertions.ts
|
|
1427
|
+
function slugifyAssertionID(prefix, index) {
|
|
1428
|
+
return `${prefix}-${String(index + 1)}`;
|
|
1429
|
+
}
|
|
1430
|
+
function appendPreActionAssertions(testCase, assertions) {
|
|
1431
|
+
const rule = testCase.evaluation;
|
|
1432
|
+
if (rule.mode !== "interact" || !rule.preActionExpectedPhrases) {
|
|
1433
|
+
return;
|
|
1434
|
+
}
|
|
1435
|
+
for (const phrase of rule.preActionExpectedPhrases) {
|
|
1436
|
+
assertions.push({
|
|
1437
|
+
id: slugifyAssertionID(testCase.slug, assertions.length),
|
|
1438
|
+
priority: "MUST",
|
|
1439
|
+
statement: `Convey initial control text "${phrase}" before activation`,
|
|
1440
|
+
featureRef: testCase.attribute,
|
|
1441
|
+
rule: {
|
|
1442
|
+
kind: "convey-phrase",
|
|
1443
|
+
phrase,
|
|
1444
|
+
scope: "pre-action"
|
|
1445
|
+
}
|
|
1446
|
+
});
|
|
1447
|
+
}
|
|
1448
|
+
}
|
|
1449
|
+
function resolvePhraseScope(mode, minCount) {
|
|
1450
|
+
if (minCount > 1) {
|
|
1451
|
+
return "any";
|
|
1452
|
+
}
|
|
1453
|
+
return mode === "interact" ? "post-action" : "target";
|
|
1454
|
+
}
|
|
1455
|
+
function formatExpectedPhraseStatement(phrase, mode, minCount) {
|
|
1456
|
+
if (minCount > 1) {
|
|
1457
|
+
return `Convey "${phrase}" across at least ${String(minCount)} elements`;
|
|
1458
|
+
}
|
|
1459
|
+
if (mode === "interact") {
|
|
1460
|
+
return `Convey dynamic announcement "${phrase}" after activation`;
|
|
1461
|
+
}
|
|
1462
|
+
return `Convey expected accessible text "${phrase}" on the target`;
|
|
1463
|
+
}
|
|
1464
|
+
function appendExpectedPhraseAssertions(testCase, assertions) {
|
|
1465
|
+
const rule = testCase.evaluation;
|
|
1466
|
+
const minCount = rule.minimumOccurrences ?? 1;
|
|
1467
|
+
const scope = resolvePhraseScope(rule.mode, minCount);
|
|
1468
|
+
for (const phrase of rule.expectedPhrases) {
|
|
1469
|
+
assertions.push({
|
|
1470
|
+
id: slugifyAssertionID(testCase.slug, assertions.length),
|
|
1471
|
+
priority: "MUST",
|
|
1472
|
+
statement: formatExpectedPhraseStatement(phrase, rule.mode, minCount),
|
|
1473
|
+
featureRef: testCase.attribute,
|
|
1474
|
+
rule: {
|
|
1475
|
+
kind: "convey-phrase",
|
|
1476
|
+
phrase,
|
|
1477
|
+
scope,
|
|
1478
|
+
minCount
|
|
1479
|
+
}
|
|
1480
|
+
});
|
|
1481
|
+
}
|
|
1482
|
+
}
|
|
1483
|
+
function appendForbiddenAssertions(testCase, assertions) {
|
|
1484
|
+
const rule = testCase.evaluation;
|
|
1485
|
+
const scope = rule.mode === "interact" ? "post-action" : "target";
|
|
1486
|
+
for (const phrase of rule.forbiddenPhrases ?? []) {
|
|
1487
|
+
assertions.push({
|
|
1488
|
+
id: slugifyAssertionID(testCase.slug, assertions.length),
|
|
1489
|
+
priority: "MUST",
|
|
1490
|
+
statement: `Do not announce overridden or prohibited phrase "${phrase}" on the target`,
|
|
1491
|
+
featureRef: testCase.attribute,
|
|
1492
|
+
rule: {
|
|
1493
|
+
kind: "omit-phrase",
|
|
1494
|
+
phrase,
|
|
1495
|
+
scope
|
|
1496
|
+
}
|
|
1497
|
+
});
|
|
1498
|
+
}
|
|
1499
|
+
}
|
|
1500
|
+
function appendMaxOccurrenceAssertions(testCase, assertions) {
|
|
1501
|
+
const maxMap = testCase.evaluation.maxPhraseOccurrences;
|
|
1502
|
+
if (!maxMap) {
|
|
1503
|
+
return;
|
|
1504
|
+
}
|
|
1505
|
+
for (const [phrase, maxAllowed] of Object.entries(maxMap)) {
|
|
1506
|
+
assertions.push({
|
|
1507
|
+
id: slugifyAssertionID(testCase.slug, assertions.length),
|
|
1508
|
+
priority: "MUST",
|
|
1509
|
+
statement: `Do not leak prohibited text "${phrase}" beyond ${String(maxAllowed)} occurrence(s)`,
|
|
1510
|
+
featureRef: testCase.attribute,
|
|
1511
|
+
rule: {
|
|
1512
|
+
kind: "max-occurrences",
|
|
1513
|
+
phrase,
|
|
1514
|
+
max: maxAllowed
|
|
1515
|
+
}
|
|
1516
|
+
});
|
|
1517
|
+
}
|
|
1518
|
+
}
|
|
1519
|
+
function appendStateAndRoleAssertions(testCase, assertions) {
|
|
1520
|
+
const rule = testCase.evaluation;
|
|
1521
|
+
const scope = rule.mode === "interact" ? "post-action" : "target";
|
|
1522
|
+
for (const stateTerm of rule.expectedStateTerms ?? []) {
|
|
1523
|
+
assertions.push({
|
|
1524
|
+
id: slugifyAssertionID(testCase.slug, assertions.length),
|
|
1525
|
+
priority: "MUST",
|
|
1526
|
+
statement: `Convey required ARIA state "${stateTerm}"`,
|
|
1527
|
+
featureRef: testCase.attribute,
|
|
1528
|
+
rule: {
|
|
1529
|
+
kind: "convey-state",
|
|
1530
|
+
stateTerm,
|
|
1531
|
+
scope
|
|
1532
|
+
}
|
|
1533
|
+
});
|
|
1534
|
+
}
|
|
1535
|
+
if (rule.targetRoleHint && rule.mode === "walk") {
|
|
1536
|
+
assertions.push({
|
|
1537
|
+
id: slugifyAssertionID(testCase.slug, assertions.length),
|
|
1538
|
+
priority: "SHOULD",
|
|
1539
|
+
statement: `Convey expected semantics/role "${rule.targetRoleHint}"`,
|
|
1540
|
+
featureRef: testCase.attribute,
|
|
1541
|
+
rule: {
|
|
1542
|
+
kind: "convey-role",
|
|
1543
|
+
roleHint: rule.targetRoleHint
|
|
1544
|
+
}
|
|
1545
|
+
});
|
|
1546
|
+
}
|
|
1547
|
+
}
|
|
1548
|
+
function resolveCaseAssertions(testCase) {
|
|
1549
|
+
if (testCase.assertions && testCase.assertions.length > 0) {
|
|
1550
|
+
return testCase.assertions;
|
|
1551
|
+
}
|
|
1552
|
+
const assertions = [];
|
|
1553
|
+
appendPreActionAssertions(testCase, assertions);
|
|
1554
|
+
appendExpectedPhraseAssertions(testCase, assertions);
|
|
1555
|
+
appendForbiddenAssertions(testCase, assertions);
|
|
1556
|
+
appendMaxOccurrenceAssertions(testCase, assertions);
|
|
1557
|
+
appendStateAndRoleAssertions(testCase, assertions);
|
|
1558
|
+
assertions.push({
|
|
1559
|
+
id: slugifyAssertionID(testCase.slug, assertions.length),
|
|
1560
|
+
priority: "MUST",
|
|
1561
|
+
statement: "Cause no severe negative side effects",
|
|
1562
|
+
featureRef: testCase.attribute,
|
|
1563
|
+
rule: {
|
|
1564
|
+
kind: "no-side-effects"
|
|
1565
|
+
}
|
|
1566
|
+
});
|
|
1567
|
+
return assertions;
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1570
|
+
// src/index.ts
|
|
1571
|
+
function resetSupportDataCache() {
|
|
1572
|
+
resetAriaAtCache();
|
|
1573
|
+
resetResultsCache();
|
|
1574
|
+
resetFeaturesCache();
|
|
1575
|
+
}
|
|
1576
|
+
export {
|
|
1577
|
+
buildEnvironmentKey,
|
|
1578
|
+
createEmptyPriorityCounts,
|
|
1579
|
+
deriveOutcomeFromSummary,
|
|
1580
|
+
formatCategoryLabel,
|
|
1581
|
+
formatOutcomeLabel,
|
|
1582
|
+
getAriaAtPlanBySlug,
|
|
1583
|
+
getAriaAtSummary,
|
|
1584
|
+
getFeatureReport,
|
|
1585
|
+
getRunForTestAndEnvironment,
|
|
1586
|
+
getRunsForTest,
|
|
1587
|
+
getSummaryCounts,
|
|
1588
|
+
getSupportDataDirectories,
|
|
1589
|
+
getTestCaseBySlug,
|
|
1590
|
+
listAriaAtEnvironments,
|
|
1591
|
+
listAriaAtPlans,
|
|
1592
|
+
listAttributes,
|
|
1593
|
+
listCategories,
|
|
1594
|
+
listEnvironmentFiles,
|
|
1595
|
+
listEnvironments,
|
|
1596
|
+
listFeatureSummaryForTestAttribute,
|
|
1597
|
+
listFeatures,
|
|
1598
|
+
listTestCases,
|
|
1599
|
+
resetAriaAtCache,
|
|
1600
|
+
resetFeaturesCache,
|
|
1601
|
+
resetResultsCache,
|
|
1602
|
+
resetSupportDataCache,
|
|
1603
|
+
resolveCaseAssertions,
|
|
1604
|
+
resolveSupportDataRoot,
|
|
1605
|
+
screenReaderTests,
|
|
1606
|
+
summarizeAssertions
|
|
1607
|
+
};
|