aria-ease 6.10.0 → 6.12.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/README.md +2 -2
- package/{bin/buildContracts-S22V7AGV.js → dist/buildContracts-FT6KWUJN.js} +3 -3
- package/dist/{chunk-XERMSYEH.js → chunk-FZ7GMIJB.js} +0 -21
- package/{bin/chunk-NI3MQCAS.js → dist/chunk-GJGUY643.js} +2 -2
- package/{bin → dist}/cli.cjs +30 -67
- package/{bin → dist}/cli.js +4 -4
- package/dist/{configLoader-DWHOHXHL.js → configLoader-Q7N5XV4P.js} +2 -2
- package/{bin/configLoader-UJZHQBYS.js → dist/configLoader-REHK3S3Q.js} +1 -1
- package/{bin/contractTestRunnerPlaywright-QDXSK3FE.js → dist/contractTestRunnerPlaywright-DIXP5DQ3.js} +5 -20
- package/dist/{contractTestRunnerPlaywright-WNWQYSXZ.js → contractTestRunnerPlaywright-EWAWQVHT.js} +5 -20
- package/dist/index.cjs +164 -122
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +155 -71
- package/dist/src/{Types.d-yGC2bBaB.d.ts → Types.d-DYfYR3Vc.d.cts} +1 -1
- package/dist/src/{Types.d-yGC2bBaB.d.cts → Types.d-DYfYR3Vc.d.ts} +1 -1
- package/dist/src/accordion/index.d.cts +1 -1
- package/dist/src/accordion/index.d.ts +1 -1
- package/dist/src/block/index.d.cts +1 -1
- package/dist/src/block/index.d.ts +1 -1
- package/dist/src/checkbox/index.d.cts +1 -1
- package/dist/src/checkbox/index.d.ts +1 -1
- package/dist/src/combobox/index.d.cts +1 -1
- package/dist/src/combobox/index.d.ts +1 -1
- package/dist/src/menu/index.d.cts +1 -1
- package/dist/src/menu/index.d.ts +1 -1
- package/dist/src/radio/index.d.cts +1 -1
- package/dist/src/radio/index.d.ts +1 -1
- package/dist/src/tabs/index.d.cts +1 -1
- package/dist/src/tabs/index.d.ts +1 -1
- package/dist/src/toggle/index.d.cts +1 -1
- package/dist/src/toggle/index.d.ts +1 -1
- package/dist/src/utils/test/{chunk-XERMSYEH.js → chunk-FZ7GMIJB.js} +1 -21
- package/dist/src/utils/test/{configLoader-SHJSRG2A.js → configLoader-NA7IBCS3.js} +2 -2
- package/dist/src/utils/test/{contractTestRunnerPlaywright-Z2AHXSNM.js → contractTestRunnerPlaywright-CIZOXYRW.js} +5 -19
- package/dist/src/utils/test/dsl/index.cjs +139 -60
- package/dist/src/utils/test/dsl/index.d.cts +3 -0
- package/dist/src/utils/test/dsl/index.d.ts +3 -0
- package/dist/src/utils/test/dsl/index.js +139 -60
- package/dist/src/utils/test/index.cjs +19 -55
- package/dist/src/utils/test/index.js +16 -10
- package/{bin/test-O3J4ZPQR.js → dist/test-HBPCSYH5.js} +16 -11
- package/package.json +5 -7
- package/bin/AccordionComponentStrategy-4ZEIQ2V6.js +0 -42
- package/bin/ComboboxComponentStrategy-OGRVZXAF.js +0 -64
- package/bin/MenuComponentStrategy-JAMTCSNF.js +0 -81
- package/bin/TabsComponentStrategy-3SQURPMX.js +0 -29
- package/bin/chunk-I2KLQ2HA.js +0 -22
- package/bin/chunk-PK5L2SAF.js +0 -17
- package/bin/chunk-XERMSYEH.js +0 -363
- package/dist/src/utils/test/aria-contracts/accordion/accordion.contract.json +0 -290
- package/dist/src/utils/test/aria-contracts/combobox/combobox.listbox.contract.json +0 -463
- package/dist/src/utils/test/aria-contracts/menu/menu.contract.json +0 -562
- package/dist/src/utils/test/aria-contracts/tabs/tabs.contract.json +0 -361
- /package/{bin → dist}/audit-RM6TCZ5C.js +0 -0
- /package/{bin → dist}/badgeHelper-JOWO6RQG.js +0 -0
- /package/{bin → dist}/chunk-JJEPLK7L.js +0 -0
- /package/{bin → dist}/cli.d.cts +0 -0
- /package/{bin → dist}/cli.d.ts +0 -0
- /package/{bin → dist}/formatters-32KQIIYS.js +0 -0
package/README.md
CHANGED
|
@@ -60,7 +60,7 @@ npx aria-ease audit --url https://yoursite.com
|
|
|
60
60
|
|
|
61
61
|
#### 3. **Contract Testing** (Available Now)
|
|
62
62
|
|
|
63
|
-
This is the game-changer.
|
|
63
|
+
This is the game-changer. Encode a deterministic, testable interpretation of WAI-ARIA APG guidance into JSON "contracts" using Aria-Ease DSL API, and validate your contract against your component using Aria-Ease's Playwright runner with isolated test-harness architecture. Run it locally or in CI/CD.
|
|
64
64
|
|
|
65
65
|
Teams and experts can enforce their own standards and maintain reusability and consistency.
|
|
66
66
|
|
|
@@ -195,7 +195,7 @@ export default {
|
|
|
195
195
|
strictness: "balanced",
|
|
196
196
|
components: [
|
|
197
197
|
{
|
|
198
|
-
name: "combobox
|
|
198
|
+
name: "combobox",
|
|
199
199
|
path: "./tests/external-contracts/combobox.listbox.contract.json",
|
|
200
200
|
strategyPath: "./tests/external-strategies/CustomComboboxStrategy.js",
|
|
201
201
|
},
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import "./chunk-I2KLQ2HA.js";
|
|
2
2
|
|
|
3
|
-
// src/utils/
|
|
3
|
+
// src/utils/test/dsl/src/buildContracts.ts
|
|
4
4
|
import path from "path";
|
|
5
5
|
import fs from "fs-extra";
|
|
6
6
|
import { glob } from "fs/promises";
|
|
7
7
|
import chalk from "chalk";
|
|
8
8
|
|
|
9
|
-
// src/utils/
|
|
9
|
+
// src/utils/test/dsl/src/contractValidator.ts
|
|
10
10
|
function validateContractSchema(contract) {
|
|
11
11
|
const errors = [];
|
|
12
12
|
if (!contract || typeof contract !== "object") {
|
|
@@ -348,7 +348,7 @@ function validateTargetReferences(contract, selectorKeys) {
|
|
|
348
348
|
return errors;
|
|
349
349
|
}
|
|
350
350
|
|
|
351
|
-
// src/utils/
|
|
351
|
+
// src/utils/test/dsl/src/buildContracts.ts
|
|
352
352
|
async function buildContracts(cwd, config) {
|
|
353
353
|
const errors = [];
|
|
354
354
|
const built = [];
|
|
@@ -1,23 +1,3 @@
|
|
|
1
|
-
// src/utils/test/contract/contract.json
|
|
2
|
-
var contract_default = {
|
|
3
|
-
menu: {
|
|
4
|
-
path: "./aria-contracts/menu/menu.contract.json",
|
|
5
|
-
component: "menu"
|
|
6
|
-
},
|
|
7
|
-
"combobox.listbox": {
|
|
8
|
-
path: "./aria-contracts/combobox/combobox.listbox.contract.json",
|
|
9
|
-
component: "combobox.listbox"
|
|
10
|
-
},
|
|
11
|
-
accordion: {
|
|
12
|
-
path: "./aria-contracts/accordion/accordion.contract.json",
|
|
13
|
-
component: "accordion"
|
|
14
|
-
},
|
|
15
|
-
tabs: {
|
|
16
|
-
path: "./aria-contracts/tabs/tabs.contract.json",
|
|
17
|
-
component: "tabs"
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
|
|
21
1
|
// src/utils/test/src/ContractReporter.ts
|
|
22
2
|
var ContractReporter = class {
|
|
23
3
|
startTime = 0;
|
|
@@ -353,7 +333,6 @@ async function closeSharedBrowser() {
|
|
|
353
333
|
}
|
|
354
334
|
|
|
355
335
|
export {
|
|
356
|
-
contract_default,
|
|
357
336
|
ContractReporter,
|
|
358
337
|
normalizeLevel,
|
|
359
338
|
normalizeStrictness,
|
|
@@ -68,8 +68,8 @@ function validateConfig(config) {
|
|
|
68
68
|
if (typeof comp.name !== "string") {
|
|
69
69
|
errors.push(`test.components[${idx}].name must be a string`);
|
|
70
70
|
}
|
|
71
|
-
if (comp.
|
|
72
|
-
errors.push(`test.components[${idx}].
|
|
71
|
+
if (comp.contractPath !== void 0 && typeof comp.contractPath !== "string") {
|
|
72
|
+
errors.push(`test.components[${idx}].contractPath must be a string when provided`);
|
|
73
73
|
}
|
|
74
74
|
if (comp.strategyPath !== void 0 && typeof comp.strategyPath !== "string") {
|
|
75
75
|
errors.push(`test.components[${idx}].strategyPath must be a string when provided`);
|
package/{bin → dist}/cli.cjs
RENAMED
|
@@ -103,8 +103,8 @@ function validateConfig(config) {
|
|
|
103
103
|
if (typeof comp.name !== "string") {
|
|
104
104
|
errors.push(`test.components[${idx}].name must be a string`);
|
|
105
105
|
}
|
|
106
|
-
if (comp.
|
|
107
|
-
errors.push(`test.components[${idx}].
|
|
106
|
+
if (comp.contractPath !== void 0 && typeof comp.contractPath !== "string") {
|
|
107
|
+
errors.push(`test.components[${idx}].contractPath must be a string when provided`);
|
|
108
108
|
}
|
|
109
109
|
if (comp.strategyPath !== void 0 && typeof comp.strategyPath !== "string") {
|
|
110
110
|
errors.push(`test.components[${idx}].strategyPath must be a string when provided`);
|
|
@@ -586,31 +586,6 @@ var init_formatters = __esm({
|
|
|
586
586
|
}
|
|
587
587
|
});
|
|
588
588
|
|
|
589
|
-
// src/utils/test/contract/contract.json
|
|
590
|
-
var contract_default;
|
|
591
|
-
var init_contract = __esm({
|
|
592
|
-
"src/utils/test/contract/contract.json"() {
|
|
593
|
-
contract_default = {
|
|
594
|
-
menu: {
|
|
595
|
-
path: "./aria-contracts/menu/menu.contract.json",
|
|
596
|
-
component: "menu"
|
|
597
|
-
},
|
|
598
|
-
"combobox.listbox": {
|
|
599
|
-
path: "./aria-contracts/combobox/combobox.listbox.contract.json",
|
|
600
|
-
component: "combobox.listbox"
|
|
601
|
-
},
|
|
602
|
-
accordion: {
|
|
603
|
-
path: "./aria-contracts/accordion/accordion.contract.json",
|
|
604
|
-
component: "accordion"
|
|
605
|
-
},
|
|
606
|
-
tabs: {
|
|
607
|
-
path: "./aria-contracts/tabs/tabs.contract.json",
|
|
608
|
-
component: "tabs"
|
|
609
|
-
}
|
|
610
|
-
};
|
|
611
|
-
}
|
|
612
|
-
});
|
|
613
|
-
|
|
614
589
|
// src/utils/test/src/ContractReporter.ts
|
|
615
590
|
var ContractReporter;
|
|
616
591
|
var init_ContractReporter = __esm({
|
|
@@ -914,16 +889,13 @@ var init_strictness = __esm({
|
|
|
914
889
|
});
|
|
915
890
|
|
|
916
891
|
// src/utils/test/src/contractTestRunner.ts
|
|
917
|
-
async function runContractTests(componentName, component, strictness) {
|
|
892
|
+
async function runContractTests(contractPath, componentName, component, strictness) {
|
|
918
893
|
const reporter = new ContractReporter(false);
|
|
919
894
|
const strictnessMode = normalizeStrictness(strictness);
|
|
920
|
-
const contractTyped = contract_default;
|
|
921
|
-
const contractPath = contractTyped[componentName]?.path;
|
|
922
895
|
if (!contractPath) {
|
|
923
|
-
throw new Error(`No contract
|
|
896
|
+
throw new Error(`No contract path provided for component: ${componentName}`);
|
|
924
897
|
}
|
|
925
|
-
const
|
|
926
|
-
const contractData = await import_promises.default.readFile(resolvedPath, "utf-8");
|
|
898
|
+
const contractData = await import_promises.default.readFile(contractPath, "utf-8");
|
|
927
899
|
const componentContract = JSON.parse(contractData);
|
|
928
900
|
const totalTests = (componentContract.relationships?.length || 0) + (componentContract.static[0]?.assertions.length || 0) + componentContract.dynamic.length;
|
|
929
901
|
reporter.start(componentName, totalTests);
|
|
@@ -1078,15 +1050,13 @@ async function runContractTests(componentName, component, strictness) {
|
|
|
1078
1050
|
reporter.summary(failures);
|
|
1079
1051
|
return { passes, failures, skipped, warnings };
|
|
1080
1052
|
}
|
|
1081
|
-
var import_promises
|
|
1053
|
+
var import_promises;
|
|
1082
1054
|
var init_contractTestRunner = __esm({
|
|
1083
1055
|
"src/utils/test/src/contractTestRunner.ts"() {
|
|
1084
1056
|
"use strict";
|
|
1085
|
-
init_contract();
|
|
1086
1057
|
import_promises = __toESM(require("fs/promises"), 1);
|
|
1087
1058
|
init_ContractReporter();
|
|
1088
1059
|
init_strictness();
|
|
1089
|
-
import_meta = {};
|
|
1090
1060
|
}
|
|
1091
1061
|
});
|
|
1092
1062
|
|
|
@@ -1428,12 +1398,6 @@ var init_StrategyRegistry = __esm({
|
|
|
1428
1398
|
(m) => m.TabsComponentStrategy
|
|
1429
1399
|
)
|
|
1430
1400
|
);
|
|
1431
|
-
this.builtInStrategies.set(
|
|
1432
|
-
"combobox.listbox",
|
|
1433
|
-
() => Promise.resolve().then(() => (init_ComboboxComponentStrategy(), ComboboxComponentStrategy_exports)).then(
|
|
1434
|
-
(m) => m.ComboboxComponentStrategy
|
|
1435
|
-
)
|
|
1436
|
-
);
|
|
1437
1401
|
}
|
|
1438
1402
|
/**
|
|
1439
1403
|
* Load a strategy - either from custom path or built-in registry
|
|
@@ -1480,15 +1444,14 @@ var init_StrategyRegistry = __esm({
|
|
|
1480
1444
|
});
|
|
1481
1445
|
|
|
1482
1446
|
// src/utils/test/src/ComponentDetector.ts
|
|
1483
|
-
var import_fs, import_path4,
|
|
1447
|
+
var import_fs, import_path4, import_meta, ComponentDetector;
|
|
1484
1448
|
var init_ComponentDetector = __esm({
|
|
1485
1449
|
"src/utils/test/src/ComponentDetector.ts"() {
|
|
1486
1450
|
"use strict";
|
|
1487
1451
|
import_fs = require("fs");
|
|
1488
1452
|
import_path4 = __toESM(require("path"), 1);
|
|
1489
|
-
init_contract();
|
|
1490
1453
|
init_StrategyRegistry();
|
|
1491
|
-
|
|
1454
|
+
import_meta = {};
|
|
1492
1455
|
ComponentDetector = class {
|
|
1493
1456
|
static strategyRegistry = new StrategyRegistry();
|
|
1494
1457
|
static isComponentConfig(value) {
|
|
@@ -1508,11 +1471,7 @@ var init_ComponentDetector = __esm({
|
|
|
1508
1471
|
*/
|
|
1509
1472
|
static async detect(componentName, componentConfig, actionTimeoutMs = 400, assertionTimeoutMs = 400, configBaseDir) {
|
|
1510
1473
|
const typedComponentConfig = this.isComponentConfig(componentConfig) ? componentConfig : void 0;
|
|
1511
|
-
|
|
1512
|
-
if (!contractPath) {
|
|
1513
|
-
const contractTyped = contract_default;
|
|
1514
|
-
contractPath = contractTyped[componentName]?.path;
|
|
1515
|
-
}
|
|
1474
|
+
const contractPath = typedComponentConfig?.contractPath;
|
|
1516
1475
|
if (!contractPath) {
|
|
1517
1476
|
throw new Error(`Contract path not found for component: ${componentName}`);
|
|
1518
1477
|
}
|
|
@@ -1531,7 +1490,7 @@ var init_ComponentDetector = __esm({
|
|
|
1531
1490
|
(0, import_fs.readFileSync)(cwdResolved, "utf-8");
|
|
1532
1491
|
return cwdResolved;
|
|
1533
1492
|
} catch {
|
|
1534
|
-
return new URL(contractPath,
|
|
1493
|
+
return new URL(contractPath, import_meta.url).pathname;
|
|
1535
1494
|
}
|
|
1536
1495
|
})();
|
|
1537
1496
|
const contractData = (0, import_fs.readFileSync)(resolvedPath, "utf-8");
|
|
@@ -1545,7 +1504,7 @@ var init_ComponentDetector = __esm({
|
|
|
1545
1504
|
if (!strategyClass) {
|
|
1546
1505
|
return null;
|
|
1547
1506
|
}
|
|
1548
|
-
const mainSelector = selectors.
|
|
1507
|
+
const mainSelector = selectors.main;
|
|
1549
1508
|
if (componentName === "tabs") {
|
|
1550
1509
|
return new strategyClass(mainSelector, selectors);
|
|
1551
1510
|
}
|
|
@@ -2120,7 +2079,7 @@ __export(contractTestRunnerPlaywright_exports, {
|
|
|
2120
2079
|
});
|
|
2121
2080
|
async function runContractTestsPlaywright(componentName, url, strictness, config, configBaseDir) {
|
|
2122
2081
|
const componentConfig = config?.test?.components?.find((c) => c.name === componentName);
|
|
2123
|
-
const isCustomContract = !!componentConfig?.
|
|
2082
|
+
const isCustomContract = !!componentConfig?.contractPath;
|
|
2124
2083
|
const reporter = new ContractReporter(true, isCustomContract);
|
|
2125
2084
|
const defaultTimeouts = {
|
|
2126
2085
|
actionTimeoutMs: 400,
|
|
@@ -2160,11 +2119,7 @@ async function runContractTestsPlaywright(componentName, url, strictness, config
|
|
|
2160
2119
|
defaultTimeouts.componentReadyTimeoutMs
|
|
2161
2120
|
);
|
|
2162
2121
|
const strictnessMode = normalizeStrictness(strictness);
|
|
2163
|
-
|
|
2164
|
-
if (!contractPath) {
|
|
2165
|
-
const contractTyped = contract_default;
|
|
2166
|
-
contractPath = contractTyped[componentName]?.path;
|
|
2167
|
-
}
|
|
2122
|
+
const contractPath = componentConfig?.contractPath;
|
|
2168
2123
|
if (!contractPath) {
|
|
2169
2124
|
throw new Error(`Contract path not found for component: ${componentName}`);
|
|
2170
2125
|
}
|
|
@@ -2183,7 +2138,7 @@ async function runContractTestsPlaywright(componentName, url, strictness, config
|
|
|
2183
2138
|
(0, import_fs2.readFileSync)(cwdResolved, "utf-8");
|
|
2184
2139
|
return cwdResolved;
|
|
2185
2140
|
} catch {
|
|
2186
|
-
return new URL(contractPath,
|
|
2141
|
+
return new URL(contractPath, import_meta2.url).pathname;
|
|
2187
2142
|
}
|
|
2188
2143
|
})();
|
|
2189
2144
|
const contractData = (0, import_fs2.readFileSync)(resolvedPath, "utf-8");
|
|
@@ -2655,20 +2610,19 @@ This usually means:
|
|
|
2655
2610
|
}
|
|
2656
2611
|
return { passes, failures, skipped, warnings };
|
|
2657
2612
|
}
|
|
2658
|
-
var import_fs2, import_path5,
|
|
2613
|
+
var import_fs2, import_path5, import_meta2;
|
|
2659
2614
|
var init_contractTestRunnerPlaywright = __esm({
|
|
2660
2615
|
"src/utils/test/src/contractTestRunnerPlaywright.ts"() {
|
|
2661
2616
|
"use strict";
|
|
2662
2617
|
import_fs2 = require("fs");
|
|
2663
2618
|
import_path5 = __toESM(require("path"), 1);
|
|
2664
|
-
init_contract();
|
|
2665
2619
|
init_playwrightTestHarness();
|
|
2666
2620
|
init_ComponentDetector();
|
|
2667
2621
|
init_ContractReporter();
|
|
2668
2622
|
init_ActionExecutor();
|
|
2669
2623
|
init_AssertionRunner();
|
|
2670
2624
|
init_strictness();
|
|
2671
|
-
|
|
2625
|
+
import_meta2 = {};
|
|
2672
2626
|
}
|
|
2673
2627
|
});
|
|
2674
2628
|
|
|
@@ -2747,7 +2701,16 @@ Please start your dev server and try again.`
|
|
|
2747
2701
|
}
|
|
2748
2702
|
} else if (component) {
|
|
2749
2703
|
console.log(`\u{1F3AD} Running component contract tests in JSDOM mode`);
|
|
2750
|
-
|
|
2704
|
+
const contractPath = config.test?.components?.find((comp) => comp?.name === componentName)?.contractPath;
|
|
2705
|
+
if (!contractPath) {
|
|
2706
|
+
throw new Error(`\u274C No contract path found for component: ${componentName}`);
|
|
2707
|
+
}
|
|
2708
|
+
contract = await runContractTests(
|
|
2709
|
+
import_path6.default.resolve(configBaseDir, contractPath),
|
|
2710
|
+
componentName,
|
|
2711
|
+
component,
|
|
2712
|
+
strictness
|
|
2713
|
+
);
|
|
2751
2714
|
} else {
|
|
2752
2715
|
throw new Error("\u274C Either component or URL must be provided");
|
|
2753
2716
|
}
|
|
@@ -2865,7 +2828,7 @@ var init_test3 = __esm({
|
|
|
2865
2828
|
}
|
|
2866
2829
|
});
|
|
2867
2830
|
|
|
2868
|
-
// src/utils/
|
|
2831
|
+
// src/utils/test/dsl/src/contractValidator.ts
|
|
2869
2832
|
function validateContractSchema(contract) {
|
|
2870
2833
|
const errors = [];
|
|
2871
2834
|
if (!contract || typeof contract !== "object") {
|
|
@@ -3207,12 +3170,12 @@ function validateTargetReferences(contract, selectorKeys) {
|
|
|
3207
3170
|
return errors;
|
|
3208
3171
|
}
|
|
3209
3172
|
var init_contractValidator = __esm({
|
|
3210
|
-
"src/utils/
|
|
3173
|
+
"src/utils/test/dsl/src/contractValidator.ts"() {
|
|
3211
3174
|
"use strict";
|
|
3212
3175
|
}
|
|
3213
3176
|
});
|
|
3214
3177
|
|
|
3215
|
-
// src/utils/
|
|
3178
|
+
// src/utils/test/dsl/src/buildContracts.ts
|
|
3216
3179
|
var buildContracts_exports = {};
|
|
3217
3180
|
__export(buildContracts_exports, {
|
|
3218
3181
|
buildContracts: () => buildContracts
|
|
@@ -3330,7 +3293,7 @@ ${errorLines}`;
|
|
|
3330
3293
|
}
|
|
3331
3294
|
var import_path7, import_fs_extra3, import_promises2, import_chalk2;
|
|
3332
3295
|
var init_buildContracts = __esm({
|
|
3333
|
-
"src/utils/
|
|
3296
|
+
"src/utils/test/dsl/src/buildContracts.ts"() {
|
|
3334
3297
|
"use strict";
|
|
3335
3298
|
import_path7 = __toESM(require("path"), 1);
|
|
3336
3299
|
import_fs_extra3 = __toESM(require("fs-extra"), 1);
|
package/{bin → dist}/cli.js
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
loadConfig
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-GJGUY643.js";
|
|
5
5
|
import {
|
|
6
6
|
displayBadgeInfo,
|
|
7
7
|
promptAddBadge
|
|
@@ -122,13 +122,13 @@ program.command("audit").description("Run axe-core powered accessibility audit o
|
|
|
122
122
|
process.exit(1);
|
|
123
123
|
});
|
|
124
124
|
program.command("test").description("Run core a11y accessibility standard tests on UI components").action(async () => {
|
|
125
|
-
const { runTest } = await import("./test-
|
|
125
|
+
const { runTest } = await import("./test-HBPCSYH5.js");
|
|
126
126
|
runTest();
|
|
127
127
|
});
|
|
128
128
|
program.command("build").description("Build accessibility artifacts").addCommand(
|
|
129
129
|
new Command("contracts").description("Build DSL contracts to JSON").action(async () => {
|
|
130
|
-
const { buildContracts } = await import("./buildContracts-
|
|
131
|
-
const { loadConfig: loadConfig2 } = await import("./configLoader-
|
|
130
|
+
const { buildContracts } = await import("./buildContracts-FT6KWUJN.js");
|
|
131
|
+
const { loadConfig: loadConfig2 } = await import("./configLoader-REHK3S3Q.js");
|
|
132
132
|
const cwd = process.cwd();
|
|
133
133
|
const { config, configPath, errors } = await loadConfig2(cwd);
|
|
134
134
|
if (configPath) {
|
|
@@ -70,8 +70,8 @@ function validateConfig(config) {
|
|
|
70
70
|
if (typeof comp.name !== "string") {
|
|
71
71
|
errors.push(`test.components[${idx}].name must be a string`);
|
|
72
72
|
}
|
|
73
|
-
if (comp.
|
|
74
|
-
errors.push(`test.components[${idx}].
|
|
73
|
+
if (comp.contractPath !== void 0 && typeof comp.contractPath !== "string") {
|
|
74
|
+
errors.push(`test.components[${idx}].contractPath must be a string when provided`);
|
|
75
75
|
}
|
|
76
76
|
if (comp.strategyPath !== void 0 && typeof comp.strategyPath !== "string") {
|
|
77
77
|
errors.push(`test.components[${idx}].strategyPath must be a string when provided`);
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ContractReporter,
|
|
3
|
-
contract_default,
|
|
4
3
|
createTestPage,
|
|
5
4
|
normalizeLevel,
|
|
6
5
|
normalizeStrictness,
|
|
7
6
|
resolveEnforcement
|
|
8
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-FZ7GMIJB.js";
|
|
9
8
|
import {
|
|
10
9
|
test_exports
|
|
11
10
|
} from "./chunk-PK5L2SAF.js";
|
|
@@ -55,12 +54,6 @@ var StrategyRegistry = class {
|
|
|
55
54
|
(m) => m.TabsComponentStrategy
|
|
56
55
|
)
|
|
57
56
|
);
|
|
58
|
-
this.builtInStrategies.set(
|
|
59
|
-
"combobox.listbox",
|
|
60
|
-
() => import("./ComboboxComponentStrategy-OGRVZXAF.js").then(
|
|
61
|
-
(m) => m.ComboboxComponentStrategy
|
|
62
|
-
)
|
|
63
|
-
);
|
|
64
57
|
}
|
|
65
58
|
/**
|
|
66
59
|
* Load a strategy - either from custom path or built-in registry
|
|
@@ -124,11 +117,7 @@ var ComponentDetector = class {
|
|
|
124
117
|
*/
|
|
125
118
|
static async detect(componentName, componentConfig, actionTimeoutMs = 400, assertionTimeoutMs = 400, configBaseDir) {
|
|
126
119
|
const typedComponentConfig = this.isComponentConfig(componentConfig) ? componentConfig : void 0;
|
|
127
|
-
|
|
128
|
-
if (!contractPath) {
|
|
129
|
-
const contractTyped = contract_default;
|
|
130
|
-
contractPath = contractTyped[componentName]?.path;
|
|
131
|
-
}
|
|
120
|
+
const contractPath = typedComponentConfig?.contractPath;
|
|
132
121
|
if (!contractPath) {
|
|
133
122
|
throw new Error(`Contract path not found for component: ${componentName}`);
|
|
134
123
|
}
|
|
@@ -161,7 +150,7 @@ var ComponentDetector = class {
|
|
|
161
150
|
if (!strategyClass) {
|
|
162
151
|
return null;
|
|
163
152
|
}
|
|
164
|
-
const mainSelector = selectors.
|
|
153
|
+
const mainSelector = selectors.main;
|
|
165
154
|
if (componentName === "tabs") {
|
|
166
155
|
return new strategyClass(mainSelector, selectors);
|
|
167
156
|
}
|
|
@@ -709,7 +698,7 @@ var AssertionRunner = class {
|
|
|
709
698
|
// src/utils/test/src/contractTestRunnerPlaywright.ts
|
|
710
699
|
async function runContractTestsPlaywright(componentName, url, strictness, config, configBaseDir) {
|
|
711
700
|
const componentConfig = config?.test?.components?.find((c) => c.name === componentName);
|
|
712
|
-
const isCustomContract = !!componentConfig?.
|
|
701
|
+
const isCustomContract = !!componentConfig?.contractPath;
|
|
713
702
|
const reporter = new ContractReporter(true, isCustomContract);
|
|
714
703
|
const defaultTimeouts = {
|
|
715
704
|
actionTimeoutMs: 400,
|
|
@@ -749,11 +738,7 @@ async function runContractTestsPlaywright(componentName, url, strictness, config
|
|
|
749
738
|
defaultTimeouts.componentReadyTimeoutMs
|
|
750
739
|
);
|
|
751
740
|
const strictnessMode = normalizeStrictness(strictness);
|
|
752
|
-
|
|
753
|
-
if (!contractPath) {
|
|
754
|
-
const contractTyped = contract_default;
|
|
755
|
-
contractPath = contractTyped[componentName]?.path;
|
|
756
|
-
}
|
|
741
|
+
const contractPath = componentConfig?.contractPath;
|
|
757
742
|
if (!contractPath) {
|
|
758
743
|
throw new Error(`Contract path not found for component: ${componentName}`);
|
|
759
744
|
}
|
package/dist/{contractTestRunnerPlaywright-WNWQYSXZ.js → contractTestRunnerPlaywright-EWAWQVHT.js}
RENAMED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ContractReporter,
|
|
3
|
-
contract_default,
|
|
4
3
|
createTestPage,
|
|
5
4
|
normalizeLevel,
|
|
6
5
|
normalizeStrictness,
|
|
7
6
|
resolveEnforcement
|
|
8
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-FZ7GMIJB.js";
|
|
9
8
|
import {
|
|
10
9
|
test_exports
|
|
11
10
|
} from "./chunk-PK5L2SAF.js";
|
|
@@ -55,12 +54,6 @@ var StrategyRegistry = class {
|
|
|
55
54
|
(m) => m.TabsComponentStrategy
|
|
56
55
|
)
|
|
57
56
|
);
|
|
58
|
-
this.builtInStrategies.set(
|
|
59
|
-
"combobox.listbox",
|
|
60
|
-
() => import("./ComboboxComponentStrategy-OGRVZXAF.js").then(
|
|
61
|
-
(m) => m.ComboboxComponentStrategy
|
|
62
|
-
)
|
|
63
|
-
);
|
|
64
57
|
}
|
|
65
58
|
/**
|
|
66
59
|
* Load a strategy - either from custom path or built-in registry
|
|
@@ -124,11 +117,7 @@ var ComponentDetector = class {
|
|
|
124
117
|
*/
|
|
125
118
|
static async detect(componentName, componentConfig, actionTimeoutMs = 400, assertionTimeoutMs = 400, configBaseDir) {
|
|
126
119
|
const typedComponentConfig = this.isComponentConfig(componentConfig) ? componentConfig : void 0;
|
|
127
|
-
|
|
128
|
-
if (!contractPath) {
|
|
129
|
-
const contractTyped = contract_default;
|
|
130
|
-
contractPath = contractTyped[componentName]?.path;
|
|
131
|
-
}
|
|
120
|
+
const contractPath = typedComponentConfig?.contractPath;
|
|
132
121
|
if (!contractPath) {
|
|
133
122
|
throw new Error(`Contract path not found for component: ${componentName}`);
|
|
134
123
|
}
|
|
@@ -161,7 +150,7 @@ var ComponentDetector = class {
|
|
|
161
150
|
if (!strategyClass) {
|
|
162
151
|
return null;
|
|
163
152
|
}
|
|
164
|
-
const mainSelector = selectors.
|
|
153
|
+
const mainSelector = selectors.main;
|
|
165
154
|
if (componentName === "tabs") {
|
|
166
155
|
return new strategyClass(mainSelector, selectors);
|
|
167
156
|
}
|
|
@@ -709,7 +698,7 @@ var AssertionRunner = class {
|
|
|
709
698
|
// src/utils/test/src/contractTestRunnerPlaywright.ts
|
|
710
699
|
async function runContractTestsPlaywright(componentName, url, strictness, config, configBaseDir) {
|
|
711
700
|
const componentConfig = config?.test?.components?.find((c) => c.name === componentName);
|
|
712
|
-
const isCustomContract = !!componentConfig?.
|
|
701
|
+
const isCustomContract = !!componentConfig?.contractPath;
|
|
713
702
|
const reporter = new ContractReporter(true, isCustomContract);
|
|
714
703
|
const defaultTimeouts = {
|
|
715
704
|
actionTimeoutMs: 400,
|
|
@@ -749,11 +738,7 @@ async function runContractTestsPlaywright(componentName, url, strictness, config
|
|
|
749
738
|
defaultTimeouts.componentReadyTimeoutMs
|
|
750
739
|
);
|
|
751
740
|
const strictnessMode = normalizeStrictness(strictness);
|
|
752
|
-
|
|
753
|
-
if (!contractPath) {
|
|
754
|
-
const contractTyped = contract_default;
|
|
755
|
-
contractPath = contractTyped[componentName]?.path;
|
|
756
|
-
}
|
|
741
|
+
const contractPath = componentConfig?.contractPath;
|
|
757
742
|
if (!contractPath) {
|
|
758
743
|
throw new Error(`Contract path not found for component: ${componentName}`);
|
|
759
744
|
}
|