@ariakit/test 0.3.9 → 0.3.11
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 +9 -0
- package/cjs/__aria-role.d.cts +2 -0
- package/cjs/__aria-role.d.ts +2 -0
- package/cjs/__chunks/ERFCHS75.cjs +91 -0
- package/cjs/__chunks/{ZH5OPOS6.cjs → W53ATX47.cjs} +4 -85
- package/cjs/index.cjs +3 -2
- package/cjs/playwright.cjs +19 -0
- package/cjs/playwright.d.cts +6 -0
- package/cjs/playwright.d.ts +6 -0
- package/cjs/query.cjs +3 -2
- package/cjs/query.d.cts +150 -150
- package/cjs/query.d.ts +150 -150
- package/cjs/react.cjs +3 -2
- package/cjs/react.d.cts +2 -2
- package/cjs/react.d.ts +2 -2
- package/esm/__aria-role.d.ts +2 -0
- package/esm/__chunks/{P574EHHD.js → 2L7BSF5A.js} +3 -84
- package/esm/__chunks/CWTUOQ5Z.js +91 -0
- package/esm/index.js +2 -1
- package/esm/playwright.d.ts +6 -0
- package/esm/playwright.js +19 -0
- package/esm/query.d.ts +150 -150
- package/esm/query.js +2 -1
- package/esm/react.d.ts +2 -2
- package/esm/react.js +2 -1
- package/package.json +13 -2
- package/playwright/package.json +8 -0
package/cjs/react.cjs
CHANGED
|
@@ -24,7 +24,8 @@ var _UWCNB4SRcjs = require('./__chunks/UWCNB4SR.cjs');
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
var
|
|
27
|
+
var _W53ATX47cjs = require('./__chunks/W53ATX47.cjs');
|
|
28
|
+
require('./__chunks/ERFCHS75.cjs');
|
|
28
29
|
|
|
29
30
|
|
|
30
31
|
var _KFHFWZQNcjs = require('./__chunks/KFHFWZQN.cjs');
|
|
@@ -90,4 +91,4 @@ async function render2(ui, options) {
|
|
|
90
91
|
|
|
91
92
|
|
|
92
93
|
|
|
93
|
-
exports.blur = _CYMYDRLScjs.blur; exports.click = _7U3THWRScjs.click; exports.dispatch = _VD3ERVOFcjs.dispatch; exports.focus = _YH2W6C46cjs.focus; exports.hover = _UWCNB4SRcjs.hover; exports.mouseDown = _GIKCTITRcjs.mouseDown; exports.mouseUp = _QCXNVFD7cjs.mouseUp; exports.press = _KFHFWZQNcjs.press; exports.q =
|
|
94
|
+
exports.blur = _CYMYDRLScjs.blur; exports.click = _7U3THWRScjs.click; exports.dispatch = _VD3ERVOFcjs.dispatch; exports.focus = _YH2W6C46cjs.focus; exports.hover = _UWCNB4SRcjs.hover; exports.mouseDown = _GIKCTITRcjs.mouseDown; exports.mouseUp = _QCXNVFD7cjs.mouseUp; exports.press = _KFHFWZQNcjs.press; exports.q = _W53ATX47cjs.q; exports.query = _W53ATX47cjs.query; exports.render = render2; exports.select = _ISKAHQPCcjs.select; exports.sleep = _HQ3KUD6Fcjs.sleep; exports.tap = _DWIHFDL3cjs.tap; exports.type = _K2XRALNEcjs.type; exports.waitFor = _LG7B6NOGcjs.waitFor;
|
package/cjs/react.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
2
|
import * as ReactTestingLibrary from "@testing-library/react";
|
|
3
3
|
export * from "./index.js";
|
|
4
4
|
export interface RenderOptions extends Omit<ReactTestingLibrary.RenderOptions, "queries"> {
|
|
5
5
|
strictMode?: boolean;
|
|
6
6
|
}
|
|
7
|
-
export declare function render(ui:
|
|
7
|
+
export declare function render(ui: ReactNode, options?: RenderOptions): Promise<() => void>;
|
package/cjs/react.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
2
|
import * as ReactTestingLibrary from "@testing-library/react";
|
|
3
3
|
export * from "./index.js";
|
|
4
4
|
export interface RenderOptions extends Omit<ReactTestingLibrary.RenderOptions, "queries"> {
|
|
5
5
|
strictMode?: boolean;
|
|
6
6
|
}
|
|
7
|
-
export declare function render(ui:
|
|
7
|
+
export declare function render(ui: ReactNode, options?: RenderOptions): Promise<() => void>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const roles: readonly ["alert", "alertdialog", "application", "article", "banner", "blockquote", "button", "caption", "cell", "checkbox", "code", "columnheader", "combobox", "complementary", "contentinfo", "definition", "deletion", "dialog", "directory", "document", "emphasis", "feed", "figure", "form", "generic", "grid", "gridcell", "group", "heading", "img", "insertion", "link", "list", "listbox", "listitem", "log", "main", "marquee", "math", "menu", "menubar", "menuitem", "menuitemcheckbox", "menuitemradio", "meter", "navigation", "none", "note", "option", "paragraph", "presentation", "progressbar", "radio", "radiogroup", "region", "row", "rowgroup", "rowheader", "scrollbar", "search", "searchbox", "separator", "slider", "spinbutton", "status", "strong", "subscript", "superscript", "switch", "tab", "table", "tablist", "tabpanel", "term", "textbox", "time", "timer", "toolbar", "tooltip", "tree", "treegrid", "treeitem"];
|
|
2
|
+
export type AriaRole = (typeof roles)[number];
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import {
|
|
3
|
+
roles
|
|
4
|
+
} from "./CWTUOQ5Z.js";
|
|
2
5
|
import {
|
|
3
6
|
__spreadProps,
|
|
4
7
|
__spreadValues
|
|
@@ -6,90 +9,6 @@ import {
|
|
|
6
9
|
|
|
7
10
|
// src/query.ts
|
|
8
11
|
import { queries as baseQueries } from "@testing-library/dom";
|
|
9
|
-
var roles = [
|
|
10
|
-
"alert",
|
|
11
|
-
"alertdialog",
|
|
12
|
-
"application",
|
|
13
|
-
"article",
|
|
14
|
-
"banner",
|
|
15
|
-
"blockquote",
|
|
16
|
-
"button",
|
|
17
|
-
"caption",
|
|
18
|
-
"cell",
|
|
19
|
-
"checkbox",
|
|
20
|
-
"code",
|
|
21
|
-
"columnheader",
|
|
22
|
-
"combobox",
|
|
23
|
-
"complementary",
|
|
24
|
-
"contentinfo",
|
|
25
|
-
"definition",
|
|
26
|
-
"deletion",
|
|
27
|
-
"dialog",
|
|
28
|
-
"directory",
|
|
29
|
-
"document",
|
|
30
|
-
"emphasis",
|
|
31
|
-
"feed",
|
|
32
|
-
"figure",
|
|
33
|
-
"form",
|
|
34
|
-
"generic",
|
|
35
|
-
"grid",
|
|
36
|
-
"gridcell",
|
|
37
|
-
"group",
|
|
38
|
-
"heading",
|
|
39
|
-
"img",
|
|
40
|
-
"insertion",
|
|
41
|
-
"link",
|
|
42
|
-
"list",
|
|
43
|
-
"listbox",
|
|
44
|
-
"listitem",
|
|
45
|
-
"log",
|
|
46
|
-
"main",
|
|
47
|
-
"marquee",
|
|
48
|
-
"math",
|
|
49
|
-
"menu",
|
|
50
|
-
"menubar",
|
|
51
|
-
"menuitem",
|
|
52
|
-
"menuitemcheckbox",
|
|
53
|
-
"menuitemradio",
|
|
54
|
-
"meter",
|
|
55
|
-
"navigation",
|
|
56
|
-
"none",
|
|
57
|
-
"note",
|
|
58
|
-
"option",
|
|
59
|
-
"paragraph",
|
|
60
|
-
"presentation",
|
|
61
|
-
"progressbar",
|
|
62
|
-
"radio",
|
|
63
|
-
"radiogroup",
|
|
64
|
-
"region",
|
|
65
|
-
"row",
|
|
66
|
-
"rowgroup",
|
|
67
|
-
"rowheader",
|
|
68
|
-
"scrollbar",
|
|
69
|
-
"search",
|
|
70
|
-
"searchbox",
|
|
71
|
-
"separator",
|
|
72
|
-
"slider",
|
|
73
|
-
"spinbutton",
|
|
74
|
-
"status",
|
|
75
|
-
"strong",
|
|
76
|
-
"subscript",
|
|
77
|
-
"superscript",
|
|
78
|
-
"switch",
|
|
79
|
-
"tab",
|
|
80
|
-
"table",
|
|
81
|
-
"tablist",
|
|
82
|
-
"tabpanel",
|
|
83
|
-
"term",
|
|
84
|
-
"textbox",
|
|
85
|
-
"time",
|
|
86
|
-
"timer",
|
|
87
|
-
"toolbar",
|
|
88
|
-
"tooltip",
|
|
89
|
-
"tree",
|
|
90
|
-
"treegrid",
|
|
91
|
-
"treeitem"
|
|
92
|
-
];
|
|
93
12
|
var queries = Object.entries(baseQueries).reduce((queries2, [key, query2]) => {
|
|
94
13
|
queries2[key] = (...args) => query2(document.body, ...args);
|
|
95
14
|
return queries2;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/__aria-role.ts
|
|
4
|
+
var roles = [
|
|
5
|
+
"alert",
|
|
6
|
+
"alertdialog",
|
|
7
|
+
"application",
|
|
8
|
+
"article",
|
|
9
|
+
"banner",
|
|
10
|
+
"blockquote",
|
|
11
|
+
"button",
|
|
12
|
+
"caption",
|
|
13
|
+
"cell",
|
|
14
|
+
"checkbox",
|
|
15
|
+
"code",
|
|
16
|
+
"columnheader",
|
|
17
|
+
"combobox",
|
|
18
|
+
"complementary",
|
|
19
|
+
"contentinfo",
|
|
20
|
+
"definition",
|
|
21
|
+
"deletion",
|
|
22
|
+
"dialog",
|
|
23
|
+
"directory",
|
|
24
|
+
"document",
|
|
25
|
+
"emphasis",
|
|
26
|
+
"feed",
|
|
27
|
+
"figure",
|
|
28
|
+
"form",
|
|
29
|
+
"generic",
|
|
30
|
+
"grid",
|
|
31
|
+
"gridcell",
|
|
32
|
+
"group",
|
|
33
|
+
"heading",
|
|
34
|
+
"img",
|
|
35
|
+
"insertion",
|
|
36
|
+
"link",
|
|
37
|
+
"list",
|
|
38
|
+
"listbox",
|
|
39
|
+
"listitem",
|
|
40
|
+
"log",
|
|
41
|
+
"main",
|
|
42
|
+
"marquee",
|
|
43
|
+
"math",
|
|
44
|
+
"menu",
|
|
45
|
+
"menubar",
|
|
46
|
+
"menuitem",
|
|
47
|
+
"menuitemcheckbox",
|
|
48
|
+
"menuitemradio",
|
|
49
|
+
"meter",
|
|
50
|
+
"navigation",
|
|
51
|
+
"none",
|
|
52
|
+
"note",
|
|
53
|
+
"option",
|
|
54
|
+
"paragraph",
|
|
55
|
+
"presentation",
|
|
56
|
+
"progressbar",
|
|
57
|
+
"radio",
|
|
58
|
+
"radiogroup",
|
|
59
|
+
"region",
|
|
60
|
+
"row",
|
|
61
|
+
"rowgroup",
|
|
62
|
+
"rowheader",
|
|
63
|
+
"scrollbar",
|
|
64
|
+
"search",
|
|
65
|
+
"searchbox",
|
|
66
|
+
"separator",
|
|
67
|
+
"slider",
|
|
68
|
+
"spinbutton",
|
|
69
|
+
"status",
|
|
70
|
+
"strong",
|
|
71
|
+
"subscript",
|
|
72
|
+
"superscript",
|
|
73
|
+
"switch",
|
|
74
|
+
"tab",
|
|
75
|
+
"table",
|
|
76
|
+
"tablist",
|
|
77
|
+
"tabpanel",
|
|
78
|
+
"term",
|
|
79
|
+
"textbox",
|
|
80
|
+
"time",
|
|
81
|
+
"timer",
|
|
82
|
+
"toolbar",
|
|
83
|
+
"tooltip",
|
|
84
|
+
"tree",
|
|
85
|
+
"treegrid",
|
|
86
|
+
"treeitem"
|
|
87
|
+
];
|
|
88
|
+
|
|
89
|
+
export {
|
|
90
|
+
roles
|
|
91
|
+
};
|
package/esm/index.js
CHANGED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { FrameLocator, Locator, Page } from "@playwright/test";
|
|
2
|
+
import type { AriaRole } from "./__aria-role.js";
|
|
3
|
+
type RoleQuery = (name?: string | RegExp, options?: Parameters<Page["getByRole"]>[1]) => Locator;
|
|
4
|
+
type RoleQueries = Record<AriaRole, RoleQuery>;
|
|
5
|
+
export declare function query(locator: Page | Locator | FrameLocator): RoleQueries;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
roles
|
|
4
|
+
} from "./__chunks/CWTUOQ5Z.js";
|
|
5
|
+
import {
|
|
6
|
+
__spreadValues
|
|
7
|
+
} from "./__chunks/Q65FZOE2.js";
|
|
8
|
+
|
|
9
|
+
// src/playwright.ts
|
|
10
|
+
function query(locator) {
|
|
11
|
+
const roleQueries = roles.reduce((acc, role) => {
|
|
12
|
+
acc[role] = (name, options) => locator.getByRole(role, __spreadValues({ name }, options));
|
|
13
|
+
return acc;
|
|
14
|
+
}, {});
|
|
15
|
+
return roleQueries;
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
query
|
|
19
|
+
};
|