aria-ease 6.4.8 → 6.5.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.
Files changed (44) hide show
  1. package/README.md +15 -27
  2. package/bin/{chunk-TQBS54MM.js → chunk-AUJAN4RK.js} +35 -19
  3. package/bin/cli.cjs +952 -513
  4. package/bin/cli.js +1 -1
  5. package/bin/contractTestRunnerPlaywright-7F756CFB.js +984 -0
  6. package/bin/{test-WICJJ62P.js → test-C3CMRHSI.js} +39 -32
  7. package/dist/{chunk-TQBS54MM.js → chunk-AUJAN4RK.js} +35 -19
  8. package/dist/contractTestRunnerPlaywright-7F756CFB.js +984 -0
  9. package/dist/index.cjs +958 -519
  10. package/dist/index.js +46 -39
  11. package/dist/src/{Types.d-DYfYR3Vc.d.cts → Types.d-yGC2bBaB.d.cts} +1 -1
  12. package/dist/src/{Types.d-DYfYR3Vc.d.ts → Types.d-yGC2bBaB.d.ts} +1 -1
  13. package/dist/src/accordion/index.d.cts +1 -1
  14. package/dist/src/accordion/index.d.ts +1 -1
  15. package/dist/src/block/index.d.cts +1 -1
  16. package/dist/src/block/index.d.ts +1 -1
  17. package/dist/src/checkbox/index.d.cts +1 -1
  18. package/dist/src/checkbox/index.d.ts +1 -1
  19. package/dist/src/combobox/index.d.cts +1 -1
  20. package/dist/src/combobox/index.d.ts +1 -1
  21. package/dist/src/menu/index.cjs +7 -7
  22. package/dist/src/menu/index.d.cts +1 -1
  23. package/dist/src/menu/index.d.ts +1 -1
  24. package/dist/src/menu/index.js +7 -7
  25. package/dist/src/radio/index.d.cts +1 -1
  26. package/dist/src/radio/index.d.ts +1 -1
  27. package/dist/src/tabs/index.d.cts +1 -1
  28. package/dist/src/tabs/index.d.ts +1 -1
  29. package/dist/src/toggle/index.d.cts +1 -1
  30. package/dist/src/toggle/index.d.ts +1 -1
  31. package/dist/src/utils/test/{contracts/AccordionContract.json → aria-contracts/accordion/accordion.contract.json} +20 -7
  32. package/dist/src/utils/test/{contracts/ComboboxContract.json → aria-contracts/combobox/combobox.listbox.contract.json} +18 -17
  33. package/dist/src/utils/test/{contracts/MenuContract.json → aria-contracts/menu/menu.contract.json} +42 -1
  34. package/dist/src/utils/test/{contracts/TabsContract.json → aria-contracts/tabs/tabs.contract.json} +20 -7
  35. package/dist/src/utils/test/{chunk-TQBS54MM.js → chunk-AUJAN4RK.js} +34 -18
  36. package/dist/src/utils/test/contractTestRunnerPlaywright-HL73FADJ.js +955 -0
  37. package/dist/src/utils/test/index.cjs +921 -505
  38. package/dist/src/utils/test/index.d.cts +6 -1
  39. package/dist/src/utils/test/index.d.ts +6 -1
  40. package/dist/src/utils/test/index.js +38 -31
  41. package/package.json +2 -2
  42. package/bin/contractTestRunnerPlaywright-D57V4RSU.js +0 -628
  43. package/dist/contractTestRunnerPlaywright-D57V4RSU.js +0 -628
  44. package/dist/src/utils/test/contractTestRunnerPlaywright-HV4EIRDH.js +0 -610
@@ -3,24 +3,24 @@ import { chromium } from 'playwright';
3
3
  // src/utils/test/contract/contract.json
4
4
  var contract_default = {
5
5
  menu: {
6
- path: "./contracts/MenuContract.json",
6
+ path: "./aria-contracts/menu/menu.contract.json",
7
7
  component: "menu"
8
8
  },
9
- combobox: {
10
- path: "./contracts/ComboboxContract.json",
11
- component: "combobox"
9
+ "combobox.listbox": {
10
+ path: "./aria-contracts/combobox/combobox.listbox.contract.json",
11
+ component: "combobox.listbox"
12
12
  },
13
13
  accordion: {
14
- path: "./contracts/AccordionContract.json",
14
+ path: "./aria-contracts/accordion/accordion.contract.json",
15
15
  component: "accordion"
16
16
  },
17
17
  tabs: {
18
- path: "./contracts/TabsContract.json",
18
+ path: "./aria-contracts/tabs/tabs.contract.json",
19
19
  component: "tabs"
20
20
  }
21
21
  };
22
22
 
23
- // src/utils/test/contract/ContractReporter.ts
23
+ // src/utils/test/src/ContractReporter.ts
24
24
  var ContractReporter = class {
25
25
  startTime = 0;
26
26
  componentName = "";
@@ -32,6 +32,8 @@ var ContractReporter = class {
32
32
  optionalSuggestions = 0;
33
33
  isPlaywright = false;
34
34
  apgUrl = "https://www.w3.org/WAI/ARIA/apg/";
35
+ hasPrintedStaticSection = false;
36
+ hasPrintedDynamicSection = false;
35
37
  constructor(isPlaywright = false) {
36
38
  this.isPlaywright = isPlaywright;
37
39
  }
@@ -42,30 +44,32 @@ var ContractReporter = class {
42
44
  this.startTime = Date.now();
43
45
  this.componentName = componentName;
44
46
  this.totalTests = totalTests;
47
+ this.hasPrintedStaticSection = false;
48
+ this.hasPrintedDynamicSection = false;
45
49
  if (apgUrl) {
46
50
  this.apgUrl = apgUrl;
47
51
  }
48
52
  const mode = this.isPlaywright ? "Playwright (Real Browser)" : "jsdom (Fast)";
49
53
  this.log(`
50
54
  ${"\u2550".repeat(60)}`);
51
- this.log(`\u{1F50D} Testing ${componentName} Component - ${mode}`);
55
+ this.log(`\u{1F50D} Testing ${componentName.charAt(0).toUpperCase() + componentName.slice(1)} Component - ${mode}`);
52
56
  this.log(`${"\u2550".repeat(60)}
53
57
  `);
54
58
  }
55
59
  reportStatic(passes, failures) {
56
60
  this.staticPasses = passes;
57
61
  this.staticFailures = failures;
58
- const icon = failures === 0 ? "\u2705" : "\u274C";
59
- const status = failures === 0 ? "PASS" : "FAIL";
60
- this.log("");
61
- this.log(`${icon} Static ARIA Tests: ${status}`);
62
- this.log(` ${passes}/${passes + failures} required attributes present
63
- `);
64
62
  }
65
63
  /**
66
64
  * Report individual static test pass
67
65
  */
68
66
  reportStaticTest(description, passed, failureMessage) {
67
+ if (!this.hasPrintedStaticSection) {
68
+ this.log(`${"\u2500".repeat(60)}`);
69
+ this.log(`\u{1F9EA} Static Assertions`);
70
+ this.log(`${"\u2500".repeat(60)}`);
71
+ this.hasPrintedStaticSection = true;
72
+ }
69
73
  const icon = passed ? "\u2713" : "\u2717";
70
74
  this.log(` ${icon} ${description}`);
71
75
  if (!passed && failureMessage) {
@@ -76,13 +80,20 @@ ${"\u2550".repeat(60)}`);
76
80
  * Report individual dynamic test result
77
81
  */
78
82
  reportTest(test, status, failureMessage) {
83
+ if (!this.hasPrintedDynamicSection) {
84
+ this.log("");
85
+ this.log(`${"\u2500".repeat(60)}`);
86
+ this.log(`\u2328\uFE0F Dynamic Interaction Tests`);
87
+ this.log(`${"\u2500".repeat(60)}`);
88
+ this.hasPrintedDynamicSection = true;
89
+ }
79
90
  const result = {
80
91
  description: test.description,
81
92
  status,
82
93
  failureMessage,
83
94
  isOptional: test.isOptional
84
95
  };
85
- if (status === "skip" && test.requiresBrowser) {
96
+ if (status === "skip") {
86
97
  result.skipReason = "Requires real browser (addEventListener events)";
87
98
  }
88
99
  this.dynamicResults.push(result);
@@ -162,7 +173,7 @@ ${"\u2500".repeat(60)}`);
162
173
  });
163
174
  this.log(`
164
175
  \u{1F4A1} Run with Playwright for full validation:`);
165
- this.log(` testUiComponent('${this.componentName}', component, 'http://localhost:5173/')
176
+ this.log(` testUiComponent('${this.componentName}', null, 'http://localhost:5173/test-harness?component=component_name')
166
177
  `);
167
178
  }
168
179
  /**
@@ -186,9 +197,14 @@ ${"\u2500".repeat(60)}`);
186
197
  ${"\u2550".repeat(60)}`);
187
198
  this.log(`\u{1F4CA} Summary
188
199
  `);
200
+ const staticIcon = this.staticFailures === 0 ? "\u2705" : "\u274C";
201
+ const staticStatus = this.staticFailures === 0 ? "PASS" : "FAIL";
202
+ this.log(`${staticIcon} Static ARIA Tests: ${staticStatus}`);
203
+ this.log(` ${this.staticPasses}/${this.staticPasses + this.staticFailures} required attributes present`);
204
+ this.log("");
189
205
  if (totalFailures === 0 && this.skipped === 0 && this.optionalSuggestions === 0) {
190
206
  this.log(`\u2705 All ${totalRun} tests passed!`);
191
- this.log(` ${this.componentName} component meets WAI-ARIA expectations for Roles, States, Properties, and Keyboard Interaction \u2713`);
207
+ this.log(` ${this.componentName.charAt(0).toUpperCase()}${this.componentName.slice(1)} component meets WAI-ARIA expectations for Roles, States, Properties, and Keyboard Interactions \u2713`);
192
208
  } else if (totalFailures === 0) {
193
209
  this.log(`\u2705 ${totalPasses}/${totalRun} required tests passed`);
194
210
  if (this.skipped > 0) {
@@ -197,7 +213,7 @@ ${"\u2550".repeat(60)}`);
197
213
  if (this.optionalSuggestions > 0) {
198
214
  this.log(`\u{1F4A1} ${this.optionalSuggestions} optional enhancement${this.optionalSuggestions > 1 ? "s" : ""} suggested`);
199
215
  }
200
- this.log(` ${this.componentName} component meets WAI-ARIA expectations for Roles, States, Properties, and Keyboard Interaction \u2713`);
216
+ this.log(` ${this.componentName.charAt(0).toUpperCase()}${this.componentName.slice(1)} component meets WAI-ARIA expectations for Roles, States, Properties, and Keyboard Interactions \u2713`);
201
217
  } else {
202
218
  this.log(`\u274C ${totalFailures} test${totalFailures > 1 ? "s" : ""} failed`);
203
219
  this.log(`\u2705 ${totalPasses} test${totalPasses > 1 ? "s" : ""} passed`);