@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 CHANGED
@@ -1,5 +1,14 @@
1
1
  # @ariakit/test
2
2
 
3
+ ## 0.3.11
4
+
5
+ - Added `@ariakit/test/playwright` path with Playwright-specific query utilities.
6
+ - Updated dependencies: `@ariakit/core@0.4.2`
7
+
8
+ ## 0.3.10
9
+
10
+ - Updated dependencies: `@ariakit/core@0.4.1`
11
+
3
12
  ## 0.3.9
4
13
 
5
14
  - Queries no longer match `inert` elements.
@@ -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];
@@ -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];
@@ -0,0 +1,91 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});"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
+
90
+
91
+ exports.roles = roles;
@@ -1,95 +1,14 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
+ var _ERFCHS75cjs = require('./ERFCHS75.cjs');
5
+
6
+
4
7
 
5
8
  var _OVN5OYWKcjs = require('./OVN5OYWK.cjs');
6
9
 
7
10
  // src/query.ts
8
11
  var _dom = require('@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(_dom.queries).reduce((queries2, [key, query2]) => {
94
13
  queries2[key] = (...args) => query2(document.body, ...args);
95
14
  return queries2;
@@ -192,7 +111,7 @@ function createLabeledQuery() {
192
111
  });
193
112
  return Object.assign(queries.queryByLabelText, { all, wait, ensure });
194
113
  }
195
- var roleQueries = roles.reduce((acc, role) => {
114
+ var roleQueries = _ERFCHS75cjs.roles.reduce((acc, role) => {
196
115
  acc[role] = createRoleQuery(role);
197
116
  return acc;
198
117
  }, {});
package/cjs/index.cjs CHANGED
@@ -24,7 +24,8 @@ var _UWCNB4SRcjs = require('./__chunks/UWCNB4SR.cjs');
24
24
 
25
25
 
26
26
 
27
- var _ZH5OPOS6cjs = require('./__chunks/ZH5OPOS6.cjs');
27
+ var _W53ATX47cjs = require('./__chunks/W53ATX47.cjs');
28
+ require('./__chunks/ERFCHS75.cjs');
28
29
 
29
30
 
30
31
  var _KFHFWZQNcjs = require('./__chunks/KFHFWZQN.cjs');
@@ -61,4 +62,4 @@ require('./__chunks/OVN5OYWK.cjs');
61
62
 
62
63
 
63
64
 
64
- 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 = _ZH5OPOS6cjs.q; exports.query = _ZH5OPOS6cjs.query; exports.select = _ISKAHQPCcjs.select; exports.sleep = _HQ3KUD6Fcjs.sleep; exports.tap = _DWIHFDL3cjs.tap; exports.type = _K2XRALNEcjs.type; exports.waitFor = _LG7B6NOGcjs.waitFor;
65
+ 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.select = _ISKAHQPCcjs.select; exports.sleep = _HQ3KUD6Fcjs.sleep; exports.tap = _DWIHFDL3cjs.tap; exports.type = _K2XRALNEcjs.type; exports.waitFor = _LG7B6NOGcjs.waitFor;
@@ -0,0 +1,19 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
+
3
+
4
+ var _ERFCHS75cjs = require('./__chunks/ERFCHS75.cjs');
5
+
6
+
7
+ var _OVN5OYWKcjs = require('./__chunks/OVN5OYWK.cjs');
8
+
9
+ // src/playwright.ts
10
+ function query(locator) {
11
+ const roleQueries = _ERFCHS75cjs.roles.reduce((acc, role) => {
12
+ acc[role] = (name, options) => locator.getByRole(role, _OVN5OYWKcjs.__spreadValues.call(void 0, { name }, options));
13
+ return acc;
14
+ }, {});
15
+ return roleQueries;
16
+ }
17
+
18
+
19
+ exports.query = query;
@@ -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,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 {};
package/cjs/query.cjs CHANGED
@@ -2,9 +2,10 @@
2
2
 
3
3
 
4
4
 
5
- var _ZH5OPOS6cjs = require('./__chunks/ZH5OPOS6.cjs');
5
+ var _W53ATX47cjs = require('./__chunks/W53ATX47.cjs');
6
+ require('./__chunks/ERFCHS75.cjs');
6
7
  require('./__chunks/OVN5OYWK.cjs');
7
8
 
8
9
 
9
10
 
10
- exports.q = _ZH5OPOS6cjs.q; exports.query = _ZH5OPOS6cjs.query;
11
+ exports.q = _W53ATX47cjs.q; exports.query = _W53ATX47cjs.query;