aria-ease 6.9.0 → 6.10.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 +3 -3
- package/bin/{buildContracts-GBOY7UXG.js → buildContracts-S22V7AGV.js} +28 -0
- package/bin/{chunk-LMSKLN5O.js → chunk-NI3MQCAS.js} +34 -0
- package/bin/cli.cjs +235 -20
- package/bin/cli.js +4 -4
- package/bin/{configLoader-Q6A4JLKW.js → configLoader-UJZHQBYS.js} +1 -1
- package/{dist/contractTestRunnerPlaywright-XBWJZMR3.js → bin/contractTestRunnerPlaywright-QDXSK3FE.js} +173 -20
- package/bin/{test-OND56UUL.js → test-O3J4ZPQR.js} +2 -2
- package/dist/{configLoader-WTGJAP4Z.js → configLoader-DWHOHXHL.js} +34 -0
- package/{bin/contractTestRunnerPlaywright-ZZNWDUYP.js → dist/contractTestRunnerPlaywright-WNWQYSXZ.js} +173 -20
- package/dist/index.cjs +506 -312
- package/dist/index.d.cts +54 -54
- package/dist/index.d.ts +54 -54
- package/dist/index.js +298 -291
- package/dist/src/{Types.d-DYfYR3Vc.d.cts → Types.d-yGC2bBaB.d.cts} +1 -1
- package/dist/src/{Types.d-DYfYR3Vc.d.ts → Types.d-yGC2bBaB.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.cjs +21 -7
- package/dist/src/combobox/index.d.cts +1 -1
- package/dist/src/combobox/index.d.ts +1 -1
- package/dist/src/combobox/index.js +21 -7
- 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/{configLoader-YE2CYGDG.js → configLoader-SHJSRG2A.js} +34 -0
- package/dist/src/utils/test/{contractTestRunnerPlaywright-LC5OAVXB.js → contractTestRunnerPlaywright-Z2AHXSNM.js} +173 -20
- package/dist/src/utils/test/dsl/index.cjs +313 -0
- package/dist/src/utils/test/dsl/index.d.cts +136 -0
- package/dist/src/utils/test/dsl/index.d.ts +136 -0
- package/dist/src/utils/test/dsl/index.js +311 -0
- package/dist/src/utils/test/index.cjs +207 -20
- package/dist/src/utils/test/index.js +2 -2
- package/package.json +7 -6
package/dist/index.d.cts
CHANGED
|
@@ -194,6 +194,11 @@ declare function makeComboboxAccessible({ comboboxInputId, comboboxButtonId, lis
|
|
|
194
194
|
|
|
195
195
|
declare function makeTabsAccessible({ tabListId, tabsClass, tabPanelsClass, orientation, activateOnFocus, callback }: TabsConfig): AccessibilityInstance;
|
|
196
196
|
|
|
197
|
+
type StatePack = Record<string, {
|
|
198
|
+
setup?: DynamicAction[];
|
|
199
|
+
assertion?: DynamicAssertion[] | DynamicAssertion;
|
|
200
|
+
requires?: string[];
|
|
201
|
+
}>;
|
|
197
202
|
type Level = "required" | "recommended" | "optional";
|
|
198
203
|
type ContractMeta = {
|
|
199
204
|
id?: string;
|
|
@@ -225,13 +230,6 @@ type StaticAssertion = {
|
|
|
225
230
|
failureMessage: string;
|
|
226
231
|
level: Level;
|
|
227
232
|
};
|
|
228
|
-
type DynamicAction = {
|
|
229
|
-
type: "focus" | "type" | "click" | "keypress" | "hover";
|
|
230
|
-
target: string;
|
|
231
|
-
key?: string;
|
|
232
|
-
value?: string;
|
|
233
|
-
relativeTarget?: string;
|
|
234
|
-
};
|
|
235
233
|
type DynamicAssertion = {
|
|
236
234
|
target: string;
|
|
237
235
|
assertion: "toBeVisible" | "notToBeVisible" | "toHaveAttribute" | "toHaveValue" | "toHaveFocus" | "toHaveRole";
|
|
@@ -239,8 +237,22 @@ type DynamicAssertion = {
|
|
|
239
237
|
expectedValue?: string;
|
|
240
238
|
failureMessage?: string;
|
|
241
239
|
relativeTarget?: string;
|
|
240
|
+
virtualId?: string;
|
|
241
|
+
selectorKey?: string;
|
|
242
242
|
level?: Level;
|
|
243
243
|
};
|
|
244
|
+
type DynamicAction = {
|
|
245
|
+
type: "focus";
|
|
246
|
+
target: string;
|
|
247
|
+
relativeTarget?: "first" | "last" | "next" | "previous";
|
|
248
|
+
virtualId?: string;
|
|
249
|
+
} | {
|
|
250
|
+
type: "click" | "keypress" | "type" | "hover";
|
|
251
|
+
target: string;
|
|
252
|
+
key?: string;
|
|
253
|
+
value?: string;
|
|
254
|
+
relativeTarget?: string;
|
|
255
|
+
};
|
|
244
256
|
type DynamicTest = {
|
|
245
257
|
description: string;
|
|
246
258
|
level?: Level;
|
|
@@ -261,42 +273,6 @@ declare class FluentContract {
|
|
|
261
273
|
constructor(jsonContract: JsonContract);
|
|
262
274
|
toJSON(): JsonContract;
|
|
263
275
|
}
|
|
264
|
-
declare class StaticTargetBuilder {
|
|
265
|
-
private readonly targetName;
|
|
266
|
-
private readonly sink;
|
|
267
|
-
constructor(targetName: string, sink: StaticAssertion[]);
|
|
268
|
-
has(attribute: string, expectedValue?: string): {
|
|
269
|
-
required: () => void;
|
|
270
|
-
recommended: () => void;
|
|
271
|
-
optional: () => void;
|
|
272
|
-
};
|
|
273
|
-
}
|
|
274
|
-
declare class StaticBuilder {
|
|
275
|
-
private readonly sink;
|
|
276
|
-
constructor(sink: StaticAssertion[]);
|
|
277
|
-
target(targetName: string): StaticTargetBuilder;
|
|
278
|
-
}
|
|
279
|
-
declare class DynamicChain {
|
|
280
|
-
private readonly key;
|
|
281
|
-
private readonly testsSink;
|
|
282
|
-
private readonly selectors;
|
|
283
|
-
private selectorTarget;
|
|
284
|
-
private readonly actions;
|
|
285
|
-
private readonly assertions;
|
|
286
|
-
private explicitDescription;
|
|
287
|
-
constructor(key: string, testsSink: DynamicTest[], selectors: SelectorsMap);
|
|
288
|
-
on(target: string): this;
|
|
289
|
-
describe(description: string): this;
|
|
290
|
-
focus(targetExpression: string): this;
|
|
291
|
-
visible(target: string): this;
|
|
292
|
-
hidden(target: string): this;
|
|
293
|
-
has(target: string, attribute: string, expectedValue?: string): this;
|
|
294
|
-
required(): void;
|
|
295
|
-
recommended(): void;
|
|
296
|
-
optional(): void;
|
|
297
|
-
private finalize;
|
|
298
|
-
private parseRelativeExpression;
|
|
299
|
-
}
|
|
300
276
|
declare class ContractBuilder {
|
|
301
277
|
private readonly componentName;
|
|
302
278
|
private metaValue;
|
|
@@ -304,30 +280,54 @@ declare class ContractBuilder {
|
|
|
304
280
|
private readonly relationshipInvariants;
|
|
305
281
|
private readonly staticAssertions;
|
|
306
282
|
private readonly dynamicTests;
|
|
283
|
+
private statePack;
|
|
307
284
|
constructor(componentName: string);
|
|
308
285
|
meta(meta: ContractMeta): this;
|
|
309
286
|
selectors(selectors: SelectorsMap): this;
|
|
310
|
-
|
|
311
|
-
relationships(builderFn: (r: {
|
|
287
|
+
relationships(fn: (r: {
|
|
312
288
|
ariaReference: (from: string, attribute: string, to: string) => {
|
|
313
289
|
required: () => void;
|
|
314
|
-
recommended: () => void;
|
|
315
290
|
optional: () => void;
|
|
316
291
|
};
|
|
317
292
|
contains: (parent: string, child: string) => {
|
|
318
293
|
required: () => void;
|
|
319
|
-
recommended: () => void;
|
|
320
294
|
optional: () => void;
|
|
321
295
|
};
|
|
322
296
|
}) => void): this;
|
|
323
|
-
static(
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
297
|
+
static(fn: (s: {
|
|
298
|
+
target: (target: string) => {
|
|
299
|
+
has: (attribute: string, expectedValue: string) => {
|
|
300
|
+
required: () => void;
|
|
301
|
+
optional: () => void;
|
|
302
|
+
};
|
|
303
|
+
};
|
|
304
|
+
}) => void): this;
|
|
305
|
+
when(event: string): DynamicTestBuilder;
|
|
306
|
+
addDynamicTest(test: DynamicTest): void;
|
|
328
307
|
build(): JsonContract;
|
|
329
308
|
}
|
|
330
|
-
declare
|
|
309
|
+
declare class DynamicTestBuilder {
|
|
310
|
+
private parent;
|
|
311
|
+
private statePack;
|
|
312
|
+
private event;
|
|
313
|
+
private _as;
|
|
314
|
+
private _on;
|
|
315
|
+
private _given;
|
|
316
|
+
private _then;
|
|
317
|
+
private _desc;
|
|
318
|
+
private _level;
|
|
319
|
+
constructor(parent: ContractBuilder, statePack: StatePack, event: string);
|
|
320
|
+
as(actionType: string): this;
|
|
321
|
+
on(target: string): this;
|
|
322
|
+
given(states: string | string[]): this;
|
|
323
|
+
then(states: string | string[]): this;
|
|
324
|
+
describe(desc: string): this;
|
|
325
|
+
required(): ContractBuilder;
|
|
326
|
+
optional(): ContractBuilder;
|
|
327
|
+
recommended(): ContractBuilder;
|
|
328
|
+
private _finalize;
|
|
329
|
+
}
|
|
330
|
+
declare function createContract(componentName: string, define: (c: ContractBuilder) => void): FluentContract;
|
|
331
331
|
|
|
332
332
|
type StrictnessMode = 'minimal' | 'balanced' | 'strict' | 'paranoid';
|
|
333
333
|
|
|
@@ -348,4 +348,4 @@ declare function testUiComponent(componentName: string, component: HTMLElement |
|
|
|
348
348
|
*/
|
|
349
349
|
declare function cleanupTests(): Promise<void>;
|
|
350
350
|
|
|
351
|
-
export {
|
|
351
|
+
export { cleanupTests, createContract, makeAccordionAccessible, makeBlockAccessible, makeCheckboxAccessible, makeComboboxAccessible, makeMenuAccessible, makeRadioAccessible, makeTabsAccessible, makeToggleAccessible, testUiComponent };
|
package/dist/index.d.ts
CHANGED
|
@@ -194,6 +194,11 @@ declare function makeComboboxAccessible({ comboboxInputId, comboboxButtonId, lis
|
|
|
194
194
|
|
|
195
195
|
declare function makeTabsAccessible({ tabListId, tabsClass, tabPanelsClass, orientation, activateOnFocus, callback }: TabsConfig): AccessibilityInstance;
|
|
196
196
|
|
|
197
|
+
type StatePack = Record<string, {
|
|
198
|
+
setup?: DynamicAction[];
|
|
199
|
+
assertion?: DynamicAssertion[] | DynamicAssertion;
|
|
200
|
+
requires?: string[];
|
|
201
|
+
}>;
|
|
197
202
|
type Level = "required" | "recommended" | "optional";
|
|
198
203
|
type ContractMeta = {
|
|
199
204
|
id?: string;
|
|
@@ -225,13 +230,6 @@ type StaticAssertion = {
|
|
|
225
230
|
failureMessage: string;
|
|
226
231
|
level: Level;
|
|
227
232
|
};
|
|
228
|
-
type DynamicAction = {
|
|
229
|
-
type: "focus" | "type" | "click" | "keypress" | "hover";
|
|
230
|
-
target: string;
|
|
231
|
-
key?: string;
|
|
232
|
-
value?: string;
|
|
233
|
-
relativeTarget?: string;
|
|
234
|
-
};
|
|
235
233
|
type DynamicAssertion = {
|
|
236
234
|
target: string;
|
|
237
235
|
assertion: "toBeVisible" | "notToBeVisible" | "toHaveAttribute" | "toHaveValue" | "toHaveFocus" | "toHaveRole";
|
|
@@ -239,8 +237,22 @@ type DynamicAssertion = {
|
|
|
239
237
|
expectedValue?: string;
|
|
240
238
|
failureMessage?: string;
|
|
241
239
|
relativeTarget?: string;
|
|
240
|
+
virtualId?: string;
|
|
241
|
+
selectorKey?: string;
|
|
242
242
|
level?: Level;
|
|
243
243
|
};
|
|
244
|
+
type DynamicAction = {
|
|
245
|
+
type: "focus";
|
|
246
|
+
target: string;
|
|
247
|
+
relativeTarget?: "first" | "last" | "next" | "previous";
|
|
248
|
+
virtualId?: string;
|
|
249
|
+
} | {
|
|
250
|
+
type: "click" | "keypress" | "type" | "hover";
|
|
251
|
+
target: string;
|
|
252
|
+
key?: string;
|
|
253
|
+
value?: string;
|
|
254
|
+
relativeTarget?: string;
|
|
255
|
+
};
|
|
244
256
|
type DynamicTest = {
|
|
245
257
|
description: string;
|
|
246
258
|
level?: Level;
|
|
@@ -261,42 +273,6 @@ declare class FluentContract {
|
|
|
261
273
|
constructor(jsonContract: JsonContract);
|
|
262
274
|
toJSON(): JsonContract;
|
|
263
275
|
}
|
|
264
|
-
declare class StaticTargetBuilder {
|
|
265
|
-
private readonly targetName;
|
|
266
|
-
private readonly sink;
|
|
267
|
-
constructor(targetName: string, sink: StaticAssertion[]);
|
|
268
|
-
has(attribute: string, expectedValue?: string): {
|
|
269
|
-
required: () => void;
|
|
270
|
-
recommended: () => void;
|
|
271
|
-
optional: () => void;
|
|
272
|
-
};
|
|
273
|
-
}
|
|
274
|
-
declare class StaticBuilder {
|
|
275
|
-
private readonly sink;
|
|
276
|
-
constructor(sink: StaticAssertion[]);
|
|
277
|
-
target(targetName: string): StaticTargetBuilder;
|
|
278
|
-
}
|
|
279
|
-
declare class DynamicChain {
|
|
280
|
-
private readonly key;
|
|
281
|
-
private readonly testsSink;
|
|
282
|
-
private readonly selectors;
|
|
283
|
-
private selectorTarget;
|
|
284
|
-
private readonly actions;
|
|
285
|
-
private readonly assertions;
|
|
286
|
-
private explicitDescription;
|
|
287
|
-
constructor(key: string, testsSink: DynamicTest[], selectors: SelectorsMap);
|
|
288
|
-
on(target: string): this;
|
|
289
|
-
describe(description: string): this;
|
|
290
|
-
focus(targetExpression: string): this;
|
|
291
|
-
visible(target: string): this;
|
|
292
|
-
hidden(target: string): this;
|
|
293
|
-
has(target: string, attribute: string, expectedValue?: string): this;
|
|
294
|
-
required(): void;
|
|
295
|
-
recommended(): void;
|
|
296
|
-
optional(): void;
|
|
297
|
-
private finalize;
|
|
298
|
-
private parseRelativeExpression;
|
|
299
|
-
}
|
|
300
276
|
declare class ContractBuilder {
|
|
301
277
|
private readonly componentName;
|
|
302
278
|
private metaValue;
|
|
@@ -304,30 +280,54 @@ declare class ContractBuilder {
|
|
|
304
280
|
private readonly relationshipInvariants;
|
|
305
281
|
private readonly staticAssertions;
|
|
306
282
|
private readonly dynamicTests;
|
|
283
|
+
private statePack;
|
|
307
284
|
constructor(componentName: string);
|
|
308
285
|
meta(meta: ContractMeta): this;
|
|
309
286
|
selectors(selectors: SelectorsMap): this;
|
|
310
|
-
|
|
311
|
-
relationships(builderFn: (r: {
|
|
287
|
+
relationships(fn: (r: {
|
|
312
288
|
ariaReference: (from: string, attribute: string, to: string) => {
|
|
313
289
|
required: () => void;
|
|
314
|
-
recommended: () => void;
|
|
315
290
|
optional: () => void;
|
|
316
291
|
};
|
|
317
292
|
contains: (parent: string, child: string) => {
|
|
318
293
|
required: () => void;
|
|
319
|
-
recommended: () => void;
|
|
320
294
|
optional: () => void;
|
|
321
295
|
};
|
|
322
296
|
}) => void): this;
|
|
323
|
-
static(
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
297
|
+
static(fn: (s: {
|
|
298
|
+
target: (target: string) => {
|
|
299
|
+
has: (attribute: string, expectedValue: string) => {
|
|
300
|
+
required: () => void;
|
|
301
|
+
optional: () => void;
|
|
302
|
+
};
|
|
303
|
+
};
|
|
304
|
+
}) => void): this;
|
|
305
|
+
when(event: string): DynamicTestBuilder;
|
|
306
|
+
addDynamicTest(test: DynamicTest): void;
|
|
328
307
|
build(): JsonContract;
|
|
329
308
|
}
|
|
330
|
-
declare
|
|
309
|
+
declare class DynamicTestBuilder {
|
|
310
|
+
private parent;
|
|
311
|
+
private statePack;
|
|
312
|
+
private event;
|
|
313
|
+
private _as;
|
|
314
|
+
private _on;
|
|
315
|
+
private _given;
|
|
316
|
+
private _then;
|
|
317
|
+
private _desc;
|
|
318
|
+
private _level;
|
|
319
|
+
constructor(parent: ContractBuilder, statePack: StatePack, event: string);
|
|
320
|
+
as(actionType: string): this;
|
|
321
|
+
on(target: string): this;
|
|
322
|
+
given(states: string | string[]): this;
|
|
323
|
+
then(states: string | string[]): this;
|
|
324
|
+
describe(desc: string): this;
|
|
325
|
+
required(): ContractBuilder;
|
|
326
|
+
optional(): ContractBuilder;
|
|
327
|
+
recommended(): ContractBuilder;
|
|
328
|
+
private _finalize;
|
|
329
|
+
}
|
|
330
|
+
declare function createContract(componentName: string, define: (c: ContractBuilder) => void): FluentContract;
|
|
331
331
|
|
|
332
332
|
type StrictnessMode = 'minimal' | 'balanced' | 'strict' | 'paranoid';
|
|
333
333
|
|
|
@@ -348,4 +348,4 @@ declare function testUiComponent(componentName: string, component: HTMLElement |
|
|
|
348
348
|
*/
|
|
349
349
|
declare function cleanupTests(): Promise<void>;
|
|
350
350
|
|
|
351
|
-
export {
|
|
351
|
+
export { cleanupTests, createContract, makeAccordionAccessible, makeBlockAccessible, makeCheckboxAccessible, makeComboboxAccessible, makeMenuAccessible, makeRadioAccessible, makeTabsAccessible, makeToggleAccessible, testUiComponent };
|