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.
Files changed (60) hide show
  1. package/README.md +2 -2
  2. package/{bin/buildContracts-S22V7AGV.js → dist/buildContracts-FT6KWUJN.js} +3 -3
  3. package/dist/{chunk-XERMSYEH.js → chunk-FZ7GMIJB.js} +0 -21
  4. package/{bin/chunk-NI3MQCAS.js → dist/chunk-GJGUY643.js} +2 -2
  5. package/{bin → dist}/cli.cjs +30 -67
  6. package/{bin → dist}/cli.js +4 -4
  7. package/dist/{configLoader-DWHOHXHL.js → configLoader-Q7N5XV4P.js} +2 -2
  8. package/{bin/configLoader-UJZHQBYS.js → dist/configLoader-REHK3S3Q.js} +1 -1
  9. package/{bin/contractTestRunnerPlaywright-QDXSK3FE.js → dist/contractTestRunnerPlaywright-DIXP5DQ3.js} +5 -20
  10. package/dist/{contractTestRunnerPlaywright-WNWQYSXZ.js → contractTestRunnerPlaywright-EWAWQVHT.js} +5 -20
  11. package/dist/index.cjs +164 -122
  12. package/dist/index.d.cts +3 -0
  13. package/dist/index.d.ts +3 -0
  14. package/dist/index.js +155 -71
  15. package/dist/src/{Types.d-yGC2bBaB.d.ts → Types.d-DYfYR3Vc.d.cts} +1 -1
  16. package/dist/src/{Types.d-yGC2bBaB.d.cts → Types.d-DYfYR3Vc.d.ts} +1 -1
  17. package/dist/src/accordion/index.d.cts +1 -1
  18. package/dist/src/accordion/index.d.ts +1 -1
  19. package/dist/src/block/index.d.cts +1 -1
  20. package/dist/src/block/index.d.ts +1 -1
  21. package/dist/src/checkbox/index.d.cts +1 -1
  22. package/dist/src/checkbox/index.d.ts +1 -1
  23. package/dist/src/combobox/index.d.cts +1 -1
  24. package/dist/src/combobox/index.d.ts +1 -1
  25. package/dist/src/menu/index.d.cts +1 -1
  26. package/dist/src/menu/index.d.ts +1 -1
  27. package/dist/src/radio/index.d.cts +1 -1
  28. package/dist/src/radio/index.d.ts +1 -1
  29. package/dist/src/tabs/index.d.cts +1 -1
  30. package/dist/src/tabs/index.d.ts +1 -1
  31. package/dist/src/toggle/index.d.cts +1 -1
  32. package/dist/src/toggle/index.d.ts +1 -1
  33. package/dist/src/utils/test/{chunk-XERMSYEH.js → chunk-FZ7GMIJB.js} +1 -21
  34. package/dist/src/utils/test/{configLoader-SHJSRG2A.js → configLoader-NA7IBCS3.js} +2 -2
  35. package/dist/src/utils/test/{contractTestRunnerPlaywright-Z2AHXSNM.js → contractTestRunnerPlaywright-CIZOXYRW.js} +5 -19
  36. package/dist/src/utils/test/dsl/index.cjs +139 -60
  37. package/dist/src/utils/test/dsl/index.d.cts +3 -0
  38. package/dist/src/utils/test/dsl/index.d.ts +3 -0
  39. package/dist/src/utils/test/dsl/index.js +139 -60
  40. package/dist/src/utils/test/index.cjs +19 -55
  41. package/dist/src/utils/test/index.js +16 -10
  42. package/{bin/test-O3J4ZPQR.js → dist/test-HBPCSYH5.js} +16 -11
  43. package/package.json +5 -7
  44. package/bin/AccordionComponentStrategy-4ZEIQ2V6.js +0 -42
  45. package/bin/ComboboxComponentStrategy-OGRVZXAF.js +0 -64
  46. package/bin/MenuComponentStrategy-JAMTCSNF.js +0 -81
  47. package/bin/TabsComponentStrategy-3SQURPMX.js +0 -29
  48. package/bin/chunk-I2KLQ2HA.js +0 -22
  49. package/bin/chunk-PK5L2SAF.js +0 -17
  50. package/bin/chunk-XERMSYEH.js +0 -363
  51. package/dist/src/utils/test/aria-contracts/accordion/accordion.contract.json +0 -290
  52. package/dist/src/utils/test/aria-contracts/combobox/combobox.listbox.contract.json +0 -463
  53. package/dist/src/utils/test/aria-contracts/menu/menu.contract.json +0 -562
  54. package/dist/src/utils/test/aria-contracts/tabs/tabs.contract.json +0 -361
  55. /package/{bin → dist}/audit-RM6TCZ5C.js +0 -0
  56. /package/{bin → dist}/badgeHelper-JOWO6RQG.js +0 -0
  57. /package/{bin → dist}/chunk-JJEPLK7L.js +0 -0
  58. /package/{bin → dist}/cli.d.cts +0 -0
  59. /package/{bin → dist}/cli.d.ts +0 -0
  60. /package/{bin → dist}/formatters-32KQIIYS.js +0 -0
@@ -30,31 +30,6 @@ var __export = (target, all) => {
30
30
  __defProp(target, name, { get: all[name], enumerable: true });
31
31
  };
32
32
 
33
- // src/utils/test/contract/contract.json
34
- var contract_default;
35
- var init_contract = __esm({
36
- "src/utils/test/contract/contract.json"() {
37
- contract_default = {
38
- menu: {
39
- path: "./aria-contracts/menu/menu.contract.json",
40
- component: "menu"
41
- },
42
- "combobox.listbox": {
43
- path: "./aria-contracts/combobox/combobox.listbox.contract.json",
44
- component: "combobox.listbox"
45
- },
46
- accordion: {
47
- path: "./aria-contracts/accordion/accordion.contract.json",
48
- component: "accordion"
49
- },
50
- tabs: {
51
- path: "./aria-contracts/tabs/tabs.contract.json",
52
- component: "tabs"
53
- }
54
- };
55
- }
56
- });
57
-
58
33
  // src/utils/test/src/ContractReporter.ts
59
34
  var ContractReporter;
60
35
  var init_ContractReporter = __esm({
@@ -473,8 +448,8 @@ function validateConfig(config) {
473
448
  if (typeof comp.name !== "string") {
474
449
  errors.push(`test.components[${idx}].name must be a string`);
475
450
  }
476
- if (comp.path !== void 0 && typeof comp.path !== "string") {
477
- errors.push(`test.components[${idx}].path must be a string when provided`);
451
+ if (comp.contractPath !== void 0 && typeof comp.contractPath !== "string") {
452
+ errors.push(`test.components[${idx}].contractPath must be a string when provided`);
478
453
  }
479
454
  if (comp.strategyPath !== void 0 && typeof comp.strategyPath !== "string") {
480
455
  errors.push(`test.components[${idx}].strategyPath must be a string when provided`);
@@ -848,12 +823,6 @@ var init_StrategyRegistry = __esm({
848
823
  (m) => m.TabsComponentStrategy
849
824
  )
850
825
  );
851
- this.builtInStrategies.set(
852
- "combobox.listbox",
853
- () => Promise.resolve().then(() => (init_ComboboxComponentStrategy(), ComboboxComponentStrategy_exports)).then(
854
- (m) => m.ComboboxComponentStrategy
855
- )
856
- );
857
826
  }
858
827
  /**
859
828
  * Load a strategy - either from custom path or built-in registry
@@ -901,7 +870,6 @@ var init_StrategyRegistry = __esm({
901
870
  var ComponentDetector;
902
871
  var init_ComponentDetector = __esm({
903
872
  "src/utils/test/src/ComponentDetector.ts"() {
904
- init_contract();
905
873
  init_StrategyRegistry();
906
874
  ComponentDetector = class {
907
875
  static strategyRegistry = new StrategyRegistry();
@@ -922,11 +890,7 @@ var init_ComponentDetector = __esm({
922
890
  */
923
891
  static async detect(componentName, componentConfig, actionTimeoutMs = 400, assertionTimeoutMs = 400, configBaseDir) {
924
892
  const typedComponentConfig = this.isComponentConfig(componentConfig) ? componentConfig : void 0;
925
- let contractPath = typedComponentConfig?.path;
926
- if (!contractPath) {
927
- const contractTyped = contract_default;
928
- contractPath = contractTyped[componentName]?.path;
929
- }
893
+ const contractPath = typedComponentConfig?.contractPath;
930
894
  if (!contractPath) {
931
895
  throw new Error(`Contract path not found for component: ${componentName}`);
932
896
  }
@@ -959,7 +923,7 @@ var init_ComponentDetector = __esm({
959
923
  if (!strategyClass) {
960
924
  return null;
961
925
  }
962
- const mainSelector = selectors.trigger || selectors.input || selectors.tablist || selectors.container;
926
+ const mainSelector = selectors.main;
963
927
  if (componentName === "tabs") {
964
928
  return new strategyClass(mainSelector, selectors);
965
929
  }
@@ -1528,7 +1492,7 @@ __export(contractTestRunnerPlaywright_exports, {
1528
1492
  });
1529
1493
  async function runContractTestsPlaywright(componentName, url, strictness, config, configBaseDir) {
1530
1494
  const componentConfig = config?.test?.components?.find((c) => c.name === componentName);
1531
- const isCustomContract = !!componentConfig?.path;
1495
+ const isCustomContract = !!componentConfig?.contractPath;
1532
1496
  const reporter = new ContractReporter(true, isCustomContract);
1533
1497
  const defaultTimeouts = {
1534
1498
  actionTimeoutMs: 400,
@@ -1568,11 +1532,7 @@ async function runContractTestsPlaywright(componentName, url, strictness, config
1568
1532
  defaultTimeouts.componentReadyTimeoutMs
1569
1533
  );
1570
1534
  const strictnessMode = normalizeStrictness(strictness);
1571
- let contractPath = componentConfig?.path;
1572
- if (!contractPath) {
1573
- const contractTyped = contract_default;
1574
- contractPath = contractTyped[componentName]?.path;
1575
- }
1535
+ const contractPath = componentConfig?.contractPath;
1576
1536
  if (!contractPath) {
1577
1537
  throw new Error(`Contract path not found for component: ${componentName}`);
1578
1538
  }
@@ -2065,7 +2025,6 @@ This usually means:
2065
2025
  }
2066
2026
  var init_contractTestRunnerPlaywright = __esm({
2067
2027
  "src/utils/test/src/contractTestRunnerPlaywright.ts"() {
2068
- init_contract();
2069
2028
  init_playwrightTestHarness();
2070
2029
  init_ComponentDetector();
2071
2030
  init_ContractReporter();
@@ -2185,19 +2144,15 @@ var init_badgeHelper = __esm({
2185
2144
  });
2186
2145
 
2187
2146
  // src/utils/test/src/contractTestRunner.ts
2188
- init_contract();
2189
2147
  init_ContractReporter();
2190
2148
  init_strictness();
2191
- async function runContractTests(componentName, component, strictness) {
2149
+ async function runContractTests(contractPath, componentName, component, strictness) {
2192
2150
  const reporter = new ContractReporter(false);
2193
2151
  const strictnessMode = normalizeStrictness(strictness);
2194
- const contractTyped = contract_default;
2195
- const contractPath = contractTyped[componentName]?.path;
2196
2152
  if (!contractPath) {
2197
- throw new Error(`No contract found for component: ${componentName}`);
2153
+ throw new Error(`No contract path provided for component: ${componentName}`);
2198
2154
  }
2199
- const resolvedPath = new URL(contractPath, (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))).pathname;
2200
- const contractData = await fs__default.default.readFile(resolvedPath, "utf-8");
2155
+ const contractData = await fs__default.default.readFile(contractPath, "utf-8");
2201
2156
  const componentContract = JSON.parse(contractData);
2202
2157
  const totalTests = (componentContract.relationships?.length || 0) + (componentContract.static[0]?.assertions.length || 0) + componentContract.dynamic.length;
2203
2158
  reporter.start(componentName, totalTests);
@@ -2430,7 +2385,16 @@ Please start your dev server and try again.`
2430
2385
  }
2431
2386
  } else if (component) {
2432
2387
  console.log(`\u{1F3AD} Running component contract tests in JSDOM mode`);
2433
- contract = await runContractTests(componentName, component, strictness);
2388
+ const contractPath = config.test?.components?.find((comp) => comp?.name === componentName)?.contractPath;
2389
+ if (!contractPath) {
2390
+ throw new Error(`\u274C No contract path found for component: ${componentName}`);
2391
+ }
2392
+ contract = await runContractTests(
2393
+ path3__default.default.resolve(configBaseDir, contractPath),
2394
+ componentName,
2395
+ component,
2396
+ strictness
2397
+ );
2434
2398
  } else {
2435
2399
  throw new Error("\u274C Either component or URL must be provided");
2436
2400
  }
@@ -1,18 +1,15 @@
1
- import { normalizeStrictness, closeSharedBrowser, ContractReporter, contract_default, normalizeLevel, resolveEnforcement } from './chunk-XERMSYEH.js';
1
+ import { normalizeStrictness, closeSharedBrowser, ContractReporter, normalizeLevel, resolveEnforcement } from './chunk-FZ7GMIJB.js';
2
2
  import { axe } from 'jest-axe';
3
3
  import fs from 'fs/promises';
4
4
  import path from 'path';
5
5
 
6
- async function runContractTests(componentName, component, strictness) {
6
+ async function runContractTests(contractPath, componentName, component, strictness) {
7
7
  const reporter = new ContractReporter(false);
8
8
  const strictnessMode = normalizeStrictness(strictness);
9
- const contractTyped = contract_default;
10
- const contractPath = contractTyped[componentName]?.path;
11
9
  if (!contractPath) {
12
- throw new Error(`No contract found for component: ${componentName}`);
10
+ throw new Error(`No contract path provided for component: ${componentName}`);
13
11
  }
14
- const resolvedPath = new URL(contractPath, import.meta.url).pathname;
15
- const contractData = await fs.readFile(resolvedPath, "utf-8");
12
+ const contractData = await fs.readFile(contractPath, "utf-8");
16
13
  const componentContract = JSON.parse(contractData);
17
14
  const totalTests = (componentContract.relationships?.length || 0) + (componentContract.static[0]?.assertions.length || 0) + componentContract.dynamic.length;
18
15
  reporter.start(componentName, totalTests);
@@ -209,7 +206,7 @@ Error: ${error instanceof Error ? error.message : String(error)}`
209
206
  let configBaseDir = typeof process !== "undefined" ? process.cwd() : "";
210
207
  if (typeof process !== "undefined" && typeof process.cwd === "function") {
211
208
  try {
212
- const { loadConfig } = await import('./configLoader-SHJSRG2A.js');
209
+ const { loadConfig } = await import('./configLoader-NA7IBCS3.js');
213
210
  const result2 = await loadConfig(process.cwd());
214
211
  config = result2.config;
215
212
  if (result2.configPath) {
@@ -231,7 +228,7 @@ Error: ${error instanceof Error ? error.message : String(error)}`
231
228
  const devServerUrl = await checkDevServer(url);
232
229
  if (devServerUrl) {
233
230
  console.log(`\u{1F3AD} Running Playwright tests on ${devServerUrl}`);
234
- const { runContractTestsPlaywright } = await import('./contractTestRunnerPlaywright-Z2AHXSNM.js');
231
+ const { runContractTestsPlaywright } = await import('./contractTestRunnerPlaywright-CIZOXYRW.js');
235
232
  contract = await runContractTestsPlaywright(componentName, devServerUrl, strictness, config, configBaseDir);
236
233
  } else {
237
234
  throw new Error(
@@ -241,7 +238,16 @@ Please start your dev server and try again.`
241
238
  }
242
239
  } else if (component) {
243
240
  console.log(`\u{1F3AD} Running component contract tests in JSDOM mode`);
244
- contract = await runContractTests(componentName, component, strictness);
241
+ const contractPath = config.test?.components?.find((comp) => comp?.name === componentName)?.contractPath;
242
+ if (!contractPath) {
243
+ throw new Error(`\u274C No contract path found for component: ${componentName}`);
244
+ }
245
+ contract = await runContractTests(
246
+ path.resolve(configBaseDir, contractPath),
247
+ componentName,
248
+ component,
249
+ strictness
250
+ );
245
251
  } else {
246
252
  throw new Error("\u274C Either component or URL must be provided");
247
253
  }
@@ -1,11 +1,10 @@
1
1
  import {
2
2
  ContractReporter,
3
3
  closeSharedBrowser,
4
- contract_default,
5
4
  normalizeLevel,
6
5
  normalizeStrictness,
7
6
  resolveEnforcement
8
- } from "./chunk-XERMSYEH.js";
7
+ } from "./chunk-FZ7GMIJB.js";
9
8
  import "./chunk-I2KLQ2HA.js";
10
9
 
11
10
  // src/utils/test/src/test.ts
@@ -13,16 +12,13 @@ import { axe } from "jest-axe";
13
12
 
14
13
  // src/utils/test/src/contractTestRunner.ts
15
14
  import fs from "fs/promises";
16
- async function runContractTests(componentName, component, strictness) {
15
+ async function runContractTests(contractPath, componentName, component, strictness) {
17
16
  const reporter = new ContractReporter(false);
18
17
  const strictnessMode = normalizeStrictness(strictness);
19
- const contractTyped = contract_default;
20
- const contractPath = contractTyped[componentName]?.path;
21
18
  if (!contractPath) {
22
- throw new Error(`No contract found for component: ${componentName}`);
19
+ throw new Error(`No contract path provided for component: ${componentName}`);
23
20
  }
24
- const resolvedPath = new URL(contractPath, import.meta.url).pathname;
25
- const contractData = await fs.readFile(resolvedPath, "utf-8");
21
+ const contractData = await fs.readFile(contractPath, "utf-8");
26
22
  const componentContract = JSON.parse(contractData);
27
23
  const totalTests = (componentContract.relationships?.length || 0) + (componentContract.static[0]?.assertions.length || 0) + componentContract.dynamic.length;
28
24
  reporter.start(componentName, totalTests);
@@ -222,7 +218,7 @@ Error: ${error instanceof Error ? error.message : String(error)}`
222
218
  let configBaseDir = typeof process !== "undefined" ? process.cwd() : "";
223
219
  if (typeof process !== "undefined" && typeof process.cwd === "function") {
224
220
  try {
225
- const { loadConfig } = await import("./configLoader-UJZHQBYS.js");
221
+ const { loadConfig } = await import("./configLoader-REHK3S3Q.js");
226
222
  const result2 = await loadConfig(process.cwd());
227
223
  config = result2.config;
228
224
  if (result2.configPath) {
@@ -244,7 +240,7 @@ Error: ${error instanceof Error ? error.message : String(error)}`
244
240
  const devServerUrl = await checkDevServer(url);
245
241
  if (devServerUrl) {
246
242
  console.log(`\u{1F3AD} Running Playwright tests on ${devServerUrl}`);
247
- const { runContractTestsPlaywright } = await import("./contractTestRunnerPlaywright-QDXSK3FE.js");
243
+ const { runContractTestsPlaywright } = await import("./contractTestRunnerPlaywright-EWAWQVHT.js");
248
244
  contract = await runContractTestsPlaywright(componentName, devServerUrl, strictness, config, configBaseDir);
249
245
  } else {
250
246
  throw new Error(
@@ -254,7 +250,16 @@ Please start your dev server and try again.`
254
250
  }
255
251
  } else if (component) {
256
252
  console.log(`\u{1F3AD} Running component contract tests in JSDOM mode`);
257
- contract = await runContractTests(componentName, component, strictness);
253
+ const contractPath = config.test?.components?.find((comp) => comp?.name === componentName)?.contractPath;
254
+ if (!contractPath) {
255
+ throw new Error(`\u274C No contract path found for component: ${componentName}`);
256
+ }
257
+ contract = await runContractTests(
258
+ path.resolve(configBaseDir, contractPath),
259
+ componentName,
260
+ component,
261
+ strictness
262
+ );
258
263
  } else {
259
264
  throw new Error("\u274C Either component or URL must be provided");
260
265
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aria-ease",
3
- "version": "6.10.0",
3
+ "version": "6.12.0",
4
4
  "description": "Accessibility infrastructure for the entire frontend engineering lifecycle. Build accessible patterns, run automated audits, verify component interactions, and gate deployments — all in one system.",
5
5
  "main": "dist/index.cjs",
6
6
  "type": "module",
@@ -16,14 +16,13 @@
16
16
  "release:patch": "standard-version --release-as patch",
17
17
  "release:minor": "standard-version --release-as minor",
18
18
  "release:major": "standard-version --release-as major",
19
- "clean": "rm -rf dist bin",
19
+ "clean": "rm -rf dist",
20
20
  "build:core": "tsup ./index.ts --format esm,cjs --dts --outDir dist --external jest-axe --external @testing-library/react --external @axe-core/playwright --external playwright",
21
21
  "build:modules": "tsup ./src/combobox/index.ts ./src/accordion/index.ts ./src/block/index.ts ./src/checkbox/index.ts ./src/menu/index.ts ./src/tabs/index.ts ./src/radio/index.ts ./src/toggle/index.ts ./src/contracts/index.ts --format esm,cjs --dts --treeshake --outDir dist/src",
22
22
  "build:test": "tsup ./src/utils/test/index.ts --format esm,cjs --dts --treeshake --external jest-axe --external @testing-library/react --external playwright --external @playwright/test --outDir dist/src/utils/test",
23
23
  "build:dsl": "tsup ./src/utils/test/dsl/index.ts --format esm,cjs --dts --treeshake --outDir dist/src/utils/test/dsl",
24
- "build:cli": "tsup ./src/utils/cli/cli.ts --format esm,cjs --dts --outDir bin --external commander --external chalk --external jest-axe --external @testing-library/react --external @axe-core/playwright --external playwright",
25
- "build:contracts": "mkdir -p ./dist/src/utils/test && cp -r ./src/utils/test/contract/aria-contracts ./dist/src/utils/test/",
26
- "build": "npm run clean && npm run build:core && npm run build:modules && npm run build:test && npm run build:dsl && npm run build:cli && npm run build:contracts"
24
+ "build:cli": "tsup ./src/utils/cli/cli.ts --format esm,cjs --dts --outDir dist --external commander --external chalk --external jest-axe --external @testing-library/react --external @axe-core/playwright --external playwright",
25
+ "build": "npm run clean && npm run build:core && npm run build:modules && npm run build:test && npm run build:dsl && npm run build:cli"
27
26
  },
28
27
  "repository": {
29
28
  "type": "git",
@@ -127,7 +126,6 @@
127
126
  },
128
127
  "files": [
129
128
  "dist",
130
- "bin",
131
129
  "README.md",
132
130
  "LICENSE"
133
131
  ],
@@ -152,6 +150,6 @@
152
150
  }
153
151
  },
154
152
  "bin": {
155
- "aria-ease": "./bin/cli.js"
153
+ "aria-ease": "./dist/cli.js"
156
154
  }
157
155
  }
@@ -1,42 +0,0 @@
1
- import {
2
- test_exports
3
- } from "./chunk-PK5L2SAF.js";
4
- import "./chunk-I2KLQ2HA.js";
5
-
6
- // src/utils/test/src/component-strategies/AccordionComponentStrategy.ts
7
- var AccordionComponentStrategy = class {
8
- constructor(mainSelector, selectors, actionTimeoutMs = 400, assertionTimeoutMs = 400) {
9
- this.mainSelector = mainSelector;
10
- this.selectors = selectors;
11
- this.actionTimeoutMs = actionTimeoutMs;
12
- this.assertionTimeoutMs = assertionTimeoutMs;
13
- }
14
- async resetState(page) {
15
- if (!this.selectors.panel || !this.selectors.trigger || this.selectors.popup) {
16
- return;
17
- }
18
- const triggerSelector = this.selectors.trigger;
19
- const panelSelector = this.selectors.panel;
20
- if (!triggerSelector || !panelSelector) return;
21
- const allTriggers = await page.locator(triggerSelector).all();
22
- for (const trigger of allTriggers) {
23
- const isExpanded = await trigger.getAttribute("aria-expanded") === "true";
24
- const triggerPanel = await trigger.getAttribute("aria-controls");
25
- if (isExpanded && triggerPanel) {
26
- await trigger.click({ timeout: this.actionTimeoutMs });
27
- const panel = page.locator(`#${triggerPanel}`);
28
- await (0, test_exports.expect)(panel).toBeHidden({ timeout: this.assertionTimeoutMs }).catch(() => {
29
- });
30
- }
31
- }
32
- }
33
- async shouldSkipTest() {
34
- return false;
35
- }
36
- getMainSelector() {
37
- return this.mainSelector;
38
- }
39
- };
40
- export {
41
- AccordionComponentStrategy
42
- };
@@ -1,64 +0,0 @@
1
- import {
2
- test_exports
3
- } from "./chunk-PK5L2SAF.js";
4
- import "./chunk-I2KLQ2HA.js";
5
-
6
- // src/utils/test/src/component-strategies/ComboboxComponentStrategy.ts
7
- var ComboboxComponentStrategy = class {
8
- constructor(mainSelector, selectors, actionTimeoutMs = 400, assertionTimeoutMs = 400) {
9
- this.mainSelector = mainSelector;
10
- this.selectors = selectors;
11
- this.actionTimeoutMs = actionTimeoutMs;
12
- this.assertionTimeoutMs = assertionTimeoutMs;
13
- }
14
- async resetState(page) {
15
- if (!this.selectors.popup) return;
16
- const popupSelector = this.selectors.popup;
17
- const popupElement = page.locator(popupSelector).first();
18
- const isPopupVisible = await popupElement.isVisible().catch(() => false);
19
- if (!isPopupVisible) return;
20
- let listBoxClosed = false;
21
- let closeSelector = this.selectors.input;
22
- if (!closeSelector && this.selectors.focusable) {
23
- closeSelector = this.selectors.focusable;
24
- } else if (!closeSelector) {
25
- closeSelector = this.selectors.button;
26
- }
27
- if (closeSelector) {
28
- const closeElement = page.locator(closeSelector).first();
29
- await closeElement.focus();
30
- await page.keyboard.press("Escape");
31
- listBoxClosed = await (0, test_exports.expect)(popupElement).toBeHidden({ timeout: this.assertionTimeoutMs }).then(() => true).catch(() => false);
32
- }
33
- if (!listBoxClosed && this.selectors.button) {
34
- const buttonElement = page.locator(this.selectors.button).first();
35
- await buttonElement.click({ timeout: this.actionTimeoutMs });
36
- listBoxClosed = await (0, test_exports.expect)(popupElement).toBeHidden({ timeout: this.assertionTimeoutMs }).then(() => true).catch(() => false);
37
- }
38
- if (!listBoxClosed) {
39
- await page.mouse.click(10, 10);
40
- listBoxClosed = await (0, test_exports.expect)(popupElement).toBeHidden({ timeout: this.assertionTimeoutMs }).then(() => true).catch(() => false);
41
- }
42
- if (!listBoxClosed) {
43
- throw new Error(
44
- `\u274C FATAL: Cannot close combobox popup between tests. Popup remains visible after trying:
45
- 1. Escape key
46
- 2. Clicking button
47
- 3. Clicking outside
48
- This indicates a problem with the combobox component's close functionality.`
49
- );
50
- }
51
- if (this.selectors.input) {
52
- await page.locator(this.selectors.input).first().clear();
53
- }
54
- }
55
- async shouldSkipTest() {
56
- return false;
57
- }
58
- getMainSelector() {
59
- return this.mainSelector;
60
- }
61
- };
62
- export {
63
- ComboboxComponentStrategy
64
- };
@@ -1,81 +0,0 @@
1
- import {
2
- test_exports
3
- } from "./chunk-PK5L2SAF.js";
4
- import "./chunk-I2KLQ2HA.js";
5
-
6
- // src/utils/test/src/component-strategies/MenuComponentStrategy.ts
7
- var MenuComponentStrategy = class {
8
- constructor(mainSelector, selectors, actionTimeoutMs = 400, assertionTimeoutMs = 400) {
9
- this.mainSelector = mainSelector;
10
- this.selectors = selectors;
11
- this.actionTimeoutMs = actionTimeoutMs;
12
- this.assertionTimeoutMs = assertionTimeoutMs;
13
- }
14
- async resetState(page) {
15
- if (!this.selectors.popup) return;
16
- const popupSelector = this.selectors.popup;
17
- const popupElement = page.locator(popupSelector).first();
18
- const isPopupVisible = await popupElement.isVisible().catch(() => false);
19
- if (!isPopupVisible) return;
20
- let menuClosed = false;
21
- let closeSelector = this.selectors.input;
22
- if (!closeSelector && this.selectors.focusable) {
23
- closeSelector = this.selectors.focusable;
24
- } else if (!closeSelector) {
25
- closeSelector = this.selectors.trigger;
26
- }
27
- if (closeSelector) {
28
- const closeElement = page.locator(closeSelector).first();
29
- await closeElement.focus();
30
- await page.keyboard.press("Escape");
31
- menuClosed = await (0, test_exports.expect)(popupElement).toBeHidden({ timeout: this.assertionTimeoutMs }).then(() => true).catch(() => false);
32
- }
33
- if (!menuClosed && this.selectors.trigger) {
34
- const triggerElement = page.locator(this.selectors.trigger).first();
35
- await triggerElement.click({ timeout: this.actionTimeoutMs });
36
- menuClosed = await (0, test_exports.expect)(popupElement).toBeHidden({ timeout: this.assertionTimeoutMs }).then(() => true).catch(() => false);
37
- }
38
- if (!menuClosed) {
39
- await page.mouse.click(10, 10);
40
- menuClosed = await (0, test_exports.expect)(popupElement).toBeHidden({ timeout: this.assertionTimeoutMs }).then(() => true).catch(() => false);
41
- }
42
- if (!menuClosed) {
43
- throw new Error(
44
- `\u274C FATAL: Cannot close menu between tests. Menu remains visible after trying:
45
- 1. Escape key
46
- 2. Clicking trigger
47
- 3. Clicking outside
48
- This indicates a problem with the menu component's close functionality.`
49
- );
50
- }
51
- if (this.selectors.input) {
52
- await page.locator(this.selectors.input).first().clear();
53
- }
54
- if (this.selectors.trigger) {
55
- const triggerElement = page.locator(this.selectors.trigger).first();
56
- await triggerElement.focus();
57
- }
58
- }
59
- async shouldSkipTest(test, page) {
60
- const requiresSubmenu = test.action.some(
61
- (act) => act.target === "submenu" || act.target === "submenuTrigger" || act.target === "submenuItems"
62
- ) || test.assertions.some(
63
- (assertion) => assertion.target === "submenu" || assertion.target === "submenuTrigger" || assertion.target === "submenuItems"
64
- );
65
- if (!requiresSubmenu) {
66
- return false;
67
- }
68
- const submenuTriggerSelector = this.selectors.submenuTrigger;
69
- if (!submenuTriggerSelector) {
70
- return true;
71
- }
72
- const submenuTriggerCount = await page.locator(submenuTriggerSelector).count();
73
- return submenuTriggerCount === 0;
74
- }
75
- getMainSelector() {
76
- return this.mainSelector;
77
- }
78
- };
79
- export {
80
- MenuComponentStrategy
81
- };
@@ -1,29 +0,0 @@
1
- import "./chunk-I2KLQ2HA.js";
2
-
3
- // src/utils/test/src/component-strategies/TabsComponentStrategy.ts
4
- var TabsComponentStrategy = class {
5
- constructor(mainSelector, selectors) {
6
- this.mainSelector = mainSelector;
7
- this.selectors = selectors;
8
- }
9
- async resetState() {
10
- }
11
- async shouldSkipTest(test, page) {
12
- if (test.isVertical !== void 0 && this.selectors.tablist) {
13
- const tablistSelector = this.selectors.tablist;
14
- const tablist = page.locator(tablistSelector).first();
15
- const orientation = await tablist.getAttribute("aria-orientation");
16
- const isVertical = orientation === "vertical";
17
- if (test.isVertical !== isVertical) {
18
- return true;
19
- }
20
- }
21
- return false;
22
- }
23
- getMainSelector() {
24
- return this.mainSelector;
25
- }
26
- };
27
- export {
28
- TabsComponentStrategy
29
- };
@@ -1,22 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
18
-
19
- export {
20
- __export,
21
- __reExport
22
- };
@@ -1,17 +0,0 @@
1
- import {
2
- __export,
3
- __reExport
4
- } from "./chunk-I2KLQ2HA.js";
5
-
6
- // node_modules/@playwright/test/index.mjs
7
- var test_exports = {};
8
- __export(test_exports, {
9
- default: () => default2
10
- });
11
- __reExport(test_exports, test_star);
12
- import * as test_star from "playwright/test";
13
- import { default as default2 } from "playwright/test";
14
-
15
- export {
16
- test_exports
17
- };