aria-ease 6.11.0 → 6.12.1
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/dist/{ComboboxComponentStrategy-OGRVZXAF.js → ComboboxComponentStrategy-DU342VMB.js} +7 -7
- package/dist/RelativeTargetResolver-DJAITO6D.js +7 -0
- package/dist/{audit-RM6TCZ5C.js → audit-JYEPKLHR.js} +5 -0
- package/dist/{chunk-XERMSYEH.js → chunk-4DU5Z5BR.js} +0 -23
- package/dist/{chunk-NI3MQCAS.js → chunk-GJGUY643.js} +2 -2
- package/dist/chunk-GLT43UVH.js +43 -0
- package/dist/cli.cjs +147 -84
- package/dist/cli.js +5 -5
- package/dist/{configLoader-DWHOHXHL.js → configLoader-Q7N5XV4P.js} +2 -2
- package/dist/{configLoader-UJZHQBYS.js → configLoader-REHK3S3Q.js} +1 -1
- package/dist/{contractTestRunnerPlaywright-QDXSK3FE.js → contractTestRunnerPlaywright-H24LQ45R.js} +113 -72
- package/dist/{contractTestRunnerPlaywright-WNWQYSXZ.js → contractTestRunnerPlaywright-NL3JNJYH.js} +113 -72
- package/dist/index.cjs +248 -112
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +124 -41
- package/dist/src/combobox/index.cjs +1 -0
- package/dist/src/combobox/index.js +1 -0
- package/dist/src/utils/test/{ComboboxComponentStrategy-5AECQSRN.js → ComboboxComponentStrategy-XKQ72RFD.js} +7 -7
- package/dist/src/utils/test/RelativeTargetResolver-G2XDN2VV.js +1 -0
- package/dist/src/utils/test/{chunk-XERMSYEH.js → chunk-4DU5Z5BR.js} +1 -23
- package/dist/src/utils/test/chunk-GLT43UVH.js +41 -0
- package/dist/src/utils/test/{configLoader-SHJSRG2A.js → configLoader-NA7IBCS3.js} +2 -2
- package/dist/src/utils/test/{contractTestRunnerPlaywright-Z2AHXSNM.js → contractTestRunnerPlaywright-5FT6K2WN.js} +111 -71
- package/dist/src/utils/test/dsl/index.cjs +106 -29
- 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 +106 -29
- package/dist/src/utils/test/index.cjs +135 -76
- package/dist/src/utils/test/index.js +17 -11
- package/dist/{test-O3J4ZPQR.js → test-FYSJXQWO.js} +17 -12
- package/package.json +3 -4
- 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
|
@@ -1,562 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"meta": {
|
|
3
|
-
"id": "aria-ease.contract.menu",
|
|
4
|
-
"version": "1.0.0",
|
|
5
|
-
"created": "11-02-2026",
|
|
6
|
-
"lastUpdated": "19-03-2026",
|
|
7
|
-
"description": "ARIA Menu interaction contract. Validates the ARIA and interaction contract for a custom menu component following the ARIA Authoring Practices Guide menu with popup pattern",
|
|
8
|
-
"source": {
|
|
9
|
-
"apg": "https://www.w3.org/WAI/ARIA/apg/patterns/menubar/",
|
|
10
|
-
"wcag": ["2.2 AA"]
|
|
11
|
-
},
|
|
12
|
-
"W3CName": "Menu"
|
|
13
|
-
},
|
|
14
|
-
|
|
15
|
-
"selectors": {
|
|
16
|
-
"trigger": "[aria-controls][aria-haspopup][aria-expanded]:not([role='menuitem']):not([role='menuitemcheckbox']):not([role='menuitemradio'])",
|
|
17
|
-
"container": "[role=menu]",
|
|
18
|
-
"items": "[role=menuitem], [role=menuitemradio], [role=menuitemcheckbox]",
|
|
19
|
-
"submenuTrigger": "[role=menu] [role=menuitem][aria-haspopup=true], [role=menu] [role=menuitemradio][aria-haspopup=true], [role=menu] [role=menuitemcheckbox][aria-haspopup=true], [role=menu] [role=menuitem][aria-haspopup=menu], [role=menu] [role=menuitemradio][aria-haspopup=menu], [role=menu] [role=menuitemcheckbox][aria-haspopup=menu]",
|
|
20
|
-
"submenu": "[role=menu] [role=menu]",
|
|
21
|
-
"submenuItems": "[role=menu] [role=menu] > [role=menuitem], [role=menu] [role=menu] > [role=menuitemradio], [role=menu] [role=menu] > [role=menuitemcheckbox]",
|
|
22
|
-
"leafItem": "[role=menu] [role=menuitem]:not([aria-haspopup]), [role=menu] [role=menuitemradio]:not([aria-haspopup]), [role=menu] [role=menuitemcheckbox]:not([aria-haspopup])",
|
|
23
|
-
"focusable": "[role=menuitem], [role=menuitemradio], [role=menuitemcheckbox]",
|
|
24
|
-
"relative": "[role=menuitem], [role=menuitemradio], [role=menuitemcheckbox]",
|
|
25
|
-
"popup": "[role=menu]"
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
"observables": {
|
|
29
|
-
"observable": "focus | visible | attribute | role",
|
|
30
|
-
"target": "trigger | relative | menu",
|
|
31
|
-
"relative": "first | last | next | previous"
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
"relationships": [
|
|
35
|
-
{
|
|
36
|
-
"type": "aria-reference",
|
|
37
|
-
"from": "trigger",
|
|
38
|
-
"attribute": "aria-controls",
|
|
39
|
-
"to": "container",
|
|
40
|
-
"failureMessage": "Menu trigger does not conform to the ARIA Menu pattern as specified in APG 1.2. Menu trigger should have aria-controls attribute that points to the menu it controls."
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
"type": "aria-reference",
|
|
44
|
-
"from": "container",
|
|
45
|
-
"attribute": "aria-labelledby",
|
|
46
|
-
"to": "trigger",
|
|
47
|
-
"level": "optional",
|
|
48
|
-
"failureMessage": "The APG 1.2 recommends a menu container to have aria-labelledby attribute that references the trigger that controls the menu."
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
"type": "contains",
|
|
52
|
-
"parent": "container",
|
|
53
|
-
"child": "items"
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
"type": "contains",
|
|
57
|
-
"parent": "submenu",
|
|
58
|
-
"child": "submenuItems"
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
"type": "aria-reference",
|
|
62
|
-
"from": "submenuTrigger",
|
|
63
|
-
"attribute": "aria-controls",
|
|
64
|
-
"to": "submenu",
|
|
65
|
-
"failureMessage": "Submenu trigger does not conform to the ARIA Menu pattern as specified in APG 1.2. Submenu trigger should have aria-controls attribute that references the submenu it controls."
|
|
66
|
-
}
|
|
67
|
-
],
|
|
68
|
-
|
|
69
|
-
"static": [
|
|
70
|
-
{
|
|
71
|
-
"assertions": [
|
|
72
|
-
{
|
|
73
|
-
"target": "trigger",
|
|
74
|
-
"assertion": "toHaveAttribute",
|
|
75
|
-
"attribute": "aria-haspopup",
|
|
76
|
-
"expectedValue": "true | menu",
|
|
77
|
-
"failureMessage": "Menu trigger button doesn't conform to the ARIA Menu Button pattern as specified in APG 1.2. Menu button trigger should have 'aria-haspopup=true | menu' attribute. This helps assistive technology to identify the button as one that toggles a panel div display."
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
"target": "trigger",
|
|
81
|
-
"assertion": "toHaveAttribute",
|
|
82
|
-
"attribute": "aria-expanded",
|
|
83
|
-
"expectedValue": "true | false",
|
|
84
|
-
"failureMessage": "Menu trigger button doesn't conform to the ARIA Menu Button pattern as specified in APG 1.2. Menu trigger button should have 'aria-expanded=true | false' attribute. This helps assistive technology to keep track of the open or close state of the menu panel div that the button controls."
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
"target": "trigger",
|
|
88
|
-
"assertion": "toHaveAttribute",
|
|
89
|
-
"attribute": "aria-controls",
|
|
90
|
-
"failureMessage": "Menu trigger button doesn't conform to the ARIA Menu Button pattern as specified in APG 1.2. Menu trigger button should have 'aria-controls' attribute that points to the id of the menu panel div it controls with 'role=menu'. This helps assistive technology to identify the menu panel div that the button controls."
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
"target": "container",
|
|
94
|
-
"assertion": "toHaveAttribute",
|
|
95
|
-
"attribute": "aria-labelledby | aria-label",
|
|
96
|
-
"failureMessage": "Menu container doesn't conform to the ARIA Menu pattern as specified in APG 1.2. Menu container should have 'aria-labelledby' attribute that points to the id of the trigger button that controls it, or 'aria-label' that describes the purpose of the container."
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
"target": "container",
|
|
100
|
-
"assertion": "toHaveAttribute",
|
|
101
|
-
"attribute": "role",
|
|
102
|
-
"expectedValue": "menu",
|
|
103
|
-
"failureMessage": "Menu container doesn't conform to the ARIA Menu pattern as specified in APG 1.2. Menu container should have role of 'menu'."
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
"target": "items",
|
|
107
|
-
"assertion": "toHaveAttribute",
|
|
108
|
-
"attribute": "role",
|
|
109
|
-
"expectedValue": "menuitem | menuitemcheckbox | menuitemradio",
|
|
110
|
-
"failureMessage": "Menu items do not conform to the ARIA Menu pattern as specified in APG 1.2. Menu items should have role of 'menuitem', 'menuitemcheckbox', or 'menuitemradio'."
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
"target": "items",
|
|
114
|
-
"assertion": "toHaveAttribute",
|
|
115
|
-
"attribute": "tabindex",
|
|
116
|
-
"expectedValue": "-1",
|
|
117
|
-
"failureMessage": "Menu items do not conform to the ARIA Menu pattern as specified in APG 1.2. Menu items' tabindex should have value of '-1'. This ensures the menu items are excluded from the page's Tab sequence."
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
"target": "submenuTrigger",
|
|
121
|
-
"assertion": "toHaveAttribute",
|
|
122
|
-
"attribute": "aria-haspopup",
|
|
123
|
-
"expectedValue":"true | menu",
|
|
124
|
-
"failureMessage": "Submenu trigger does not conform to the ARIA Menu pattern as specified in APG 1.2. Submenu trigger should have aria-haspop set to 'true' or 'menu'."
|
|
125
|
-
}
|
|
126
|
-
]
|
|
127
|
-
}
|
|
128
|
-
],
|
|
129
|
-
|
|
130
|
-
"dynamic": [
|
|
131
|
-
{
|
|
132
|
-
"description": "Clicking the trigger opens the menu, updates ARIA expanded, and focuses the first interactive item in the menu.",
|
|
133
|
-
"action": [
|
|
134
|
-
{ "type": "click", "target": "trigger" }
|
|
135
|
-
],
|
|
136
|
-
"assertions": [
|
|
137
|
-
{
|
|
138
|
-
"target": "container",
|
|
139
|
-
"assertion": "toBeVisible",
|
|
140
|
-
"failureMessage": "Menu should be visible after clicking the trigger."
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
"target": "trigger",
|
|
144
|
-
"assertion": "toHaveAttribute",
|
|
145
|
-
"attribute": "aria-expanded",
|
|
146
|
-
"expectedValue": "true",
|
|
147
|
-
"failureMessage": "Trigger's aria-expanded attribute should be true after clicking the trigger on a closed menu."
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
"target": "relative",
|
|
151
|
-
"assertion": "toHaveFocus",
|
|
152
|
-
"expectedValue": "first",
|
|
153
|
-
"failureMessage": "First interactive item in the menu should have focus after clicking the trigger on a closed menu."
|
|
154
|
-
}
|
|
155
|
-
]
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
"description": "Clicking the trigger again closes the menu, updates ARIA expanded, and returns focus to trigger.",
|
|
159
|
-
"action": [
|
|
160
|
-
{ "type": "click", "target": "trigger" },
|
|
161
|
-
{ "type": "click", "target": "trigger" }
|
|
162
|
-
],
|
|
163
|
-
"assertions": [
|
|
164
|
-
{
|
|
165
|
-
"target": "container",
|
|
166
|
-
"assertion": "notToBeVisible",
|
|
167
|
-
"failureMessage": "Menu should not be visible after clicking the trigger twice."
|
|
168
|
-
},
|
|
169
|
-
{
|
|
170
|
-
"target": "trigger",
|
|
171
|
-
"assertion": "toHaveAttribute",
|
|
172
|
-
"attribute": "aria-expanded",
|
|
173
|
-
"expectedValue": "false",
|
|
174
|
-
"failureMessage": "Trigger's aria-expanded attribute should be false after closing menu."
|
|
175
|
-
},
|
|
176
|
-
{
|
|
177
|
-
"target": "trigger",
|
|
178
|
-
"assertion": "toHaveFocus",
|
|
179
|
-
"failureMessage": "Trigger should have focus after closing the menu."
|
|
180
|
-
}
|
|
181
|
-
]
|
|
182
|
-
},
|
|
183
|
-
{
|
|
184
|
-
"description": "Pressing Enter on trigger opens the menu, updates ARIA expanded, and focuses first item.",
|
|
185
|
-
"action": [
|
|
186
|
-
{ "type": "keypress", "target": "trigger", "key": "Enter" }
|
|
187
|
-
],
|
|
188
|
-
"assertions": [
|
|
189
|
-
{
|
|
190
|
-
"target": "container",
|
|
191
|
-
"assertion": "toBeVisible",
|
|
192
|
-
"failureMessage": "Menu should be visible after pressing Enter on trigger."
|
|
193
|
-
},
|
|
194
|
-
{
|
|
195
|
-
"target": "trigger",
|
|
196
|
-
"assertion": "toHaveAttribute",
|
|
197
|
-
"attribute": "aria-expanded",
|
|
198
|
-
"expectedValue": "true",
|
|
199
|
-
"failureMessage": "Trigger's should have aria-expanded=true after pressing Enter."
|
|
200
|
-
},
|
|
201
|
-
{
|
|
202
|
-
"target": "relative",
|
|
203
|
-
"assertion": "toHaveFocus",
|
|
204
|
-
"expectedValue": "first",
|
|
205
|
-
"failureMessage": "First menu item should have focus after pressing Enter."
|
|
206
|
-
}
|
|
207
|
-
]
|
|
208
|
-
},
|
|
209
|
-
{
|
|
210
|
-
"description": "Pressing Space on trigger opens the menu, updates ARIA expanded, and focuses first item.",
|
|
211
|
-
"action": [
|
|
212
|
-
{ "type": "keypress", "target": "trigger", "key": "Space" }
|
|
213
|
-
],
|
|
214
|
-
"assertions": [
|
|
215
|
-
{
|
|
216
|
-
"target": "container",
|
|
217
|
-
"assertion": "toBeVisible",
|
|
218
|
-
"failureMessage": "Menu should be visible after pressing Space on trigger."
|
|
219
|
-
},
|
|
220
|
-
{
|
|
221
|
-
"target": "trigger",
|
|
222
|
-
"assertion": "toHaveAttribute",
|
|
223
|
-
"attribute": "aria-expanded",
|
|
224
|
-
"expectedValue": "true",
|
|
225
|
-
"failureMessage": "Trigger's should have aria-expanded=true after pressing Space."
|
|
226
|
-
},
|
|
227
|
-
{
|
|
228
|
-
"target": "relative",
|
|
229
|
-
"assertion": "toHaveFocus",
|
|
230
|
-
"expectedValue": "first",
|
|
231
|
-
"failureMessage": "First menu item should have focus after pressing Space."
|
|
232
|
-
}
|
|
233
|
-
]
|
|
234
|
-
},
|
|
235
|
-
{
|
|
236
|
-
"description": "Down Arrow moves focus to next menu item.",
|
|
237
|
-
"action": [
|
|
238
|
-
{ "type": "click", "target": "trigger" },
|
|
239
|
-
{ "type": "keypress", "target": "focusable", "key": "ArrowDown" }
|
|
240
|
-
],
|
|
241
|
-
"assertions": [
|
|
242
|
-
{
|
|
243
|
-
"target": "relative",
|
|
244
|
-
"assertion": "toHaveFocus",
|
|
245
|
-
"expectedValue": "second",
|
|
246
|
-
"failureMessage": "Down Arrow should move focus to next menu item."
|
|
247
|
-
}
|
|
248
|
-
]
|
|
249
|
-
},
|
|
250
|
-
{
|
|
251
|
-
"description": "Up Arrow moves focus to previous menu item.",
|
|
252
|
-
"action": [
|
|
253
|
-
{ "type": "click", "target": "trigger" },
|
|
254
|
-
{ "type": "keypress", "target": "focusable", "key": "ArrowDown" },
|
|
255
|
-
{ "type": "keypress", "target": "focusable", "key": "ArrowUp" }
|
|
256
|
-
],
|
|
257
|
-
"assertions": [
|
|
258
|
-
{
|
|
259
|
-
"target": "relative",
|
|
260
|
-
"assertion": "toHaveFocus",
|
|
261
|
-
"expectedValue": "first",
|
|
262
|
-
"failureMessage": "Up Arrow should move focus to previous menu item."
|
|
263
|
-
}
|
|
264
|
-
]
|
|
265
|
-
},
|
|
266
|
-
{
|
|
267
|
-
"description": "Up Arrow from first item wraps to last.",
|
|
268
|
-
"action": [
|
|
269
|
-
{ "type": "click", "target": "trigger" },
|
|
270
|
-
{ "type": "keypress", "target": "focusable", "key": "ArrowUp" }
|
|
271
|
-
|
|
272
|
-
],
|
|
273
|
-
"assertions": [
|
|
274
|
-
{
|
|
275
|
-
"target": "relative",
|
|
276
|
-
"assertion": "toHaveFocus",
|
|
277
|
-
"expectedValue": "last",
|
|
278
|
-
"failureMessage": "Up Arrow should wrap focus from first item wraps to last."
|
|
279
|
-
}
|
|
280
|
-
]
|
|
281
|
-
},
|
|
282
|
-
{
|
|
283
|
-
"description": "Down Arrow from last item wraps to first item.",
|
|
284
|
-
"action": [
|
|
285
|
-
{ "type": "click", "target": "trigger" },
|
|
286
|
-
{ "type": "keypress", "target": "focusable", "key": "ArrowUp" },
|
|
287
|
-
{ "type": "keypress", "target": "focusable", "key": "ArrowDown" }
|
|
288
|
-
],
|
|
289
|
-
"assertions": [
|
|
290
|
-
{
|
|
291
|
-
"target": "relative",
|
|
292
|
-
"assertion": "toHaveFocus",
|
|
293
|
-
"expectedValue": "first",
|
|
294
|
-
"failureMessage": "Down Arrow should wrap focus from last item wraps to first item."
|
|
295
|
-
}
|
|
296
|
-
]
|
|
297
|
-
},
|
|
298
|
-
{
|
|
299
|
-
"description": "Escape closes the menu, updates ARIA expanded, and returns focus to trigger.",
|
|
300
|
-
"action": [
|
|
301
|
-
{ "type": "click", "target": "trigger" },
|
|
302
|
-
{ "type": "keypress", "target": "focusable", "key": "Escape" }
|
|
303
|
-
],
|
|
304
|
-
"assertions": [
|
|
305
|
-
{
|
|
306
|
-
"target": "container",
|
|
307
|
-
"assertion": "notToBeVisible",
|
|
308
|
-
"failureMessage": "Menu should close after pressing Escape."
|
|
309
|
-
},
|
|
310
|
-
{
|
|
311
|
-
"target": "trigger",
|
|
312
|
-
"assertion": "toHaveAttribute",
|
|
313
|
-
"attribute": "aria-expanded",
|
|
314
|
-
"expectedValue": "false",
|
|
315
|
-
"failureMessage": "Trigger's aria-expanded should be false after Escape."
|
|
316
|
-
},
|
|
317
|
-
{
|
|
318
|
-
"target": "trigger",
|
|
319
|
-
"assertion": "toHaveFocus",
|
|
320
|
-
"failureMessage": "Trigger should have focus after pressing Escape."
|
|
321
|
-
}
|
|
322
|
-
]
|
|
323
|
-
},
|
|
324
|
-
{
|
|
325
|
-
"description": "Pressing Enter on trigger when menu is open closes the menu and updates ARIA expanded.",
|
|
326
|
-
"action": [
|
|
327
|
-
{ "type": "click", "target": "trigger" },
|
|
328
|
-
{ "type": "keypress", "target": "trigger", "key": "Enter" }
|
|
329
|
-
],
|
|
330
|
-
"assertions": [
|
|
331
|
-
{
|
|
332
|
-
"target": "container",
|
|
333
|
-
"assertion": "notToBeVisible",
|
|
334
|
-
"failureMessage": "Menu should close after pressing Enter on trigger when menu is open."
|
|
335
|
-
},
|
|
336
|
-
{
|
|
337
|
-
"target": "trigger",
|
|
338
|
-
"assertion": "toHaveAttribute",
|
|
339
|
-
"attribute": "aria-expanded",
|
|
340
|
-
"expectedValue": "false",
|
|
341
|
-
"failureMessage": "Trigger's aria-expanded should be false after pressing Enter on open menu."
|
|
342
|
-
}
|
|
343
|
-
]
|
|
344
|
-
},
|
|
345
|
-
{
|
|
346
|
-
"description": "Pressing Space on trigger when menu is open closes the menu and updates ARIA expanded.",
|
|
347
|
-
"action": [
|
|
348
|
-
{ "type": "click", "target": "trigger" },
|
|
349
|
-
{ "type": "keypress", "target": "trigger", "key": "Space" }
|
|
350
|
-
],
|
|
351
|
-
"assertions": [
|
|
352
|
-
{
|
|
353
|
-
"target": "container",
|
|
354
|
-
"assertion": "notToBeVisible",
|
|
355
|
-
"failureMessage": "Menu should close after pressing Space on trigger when menu is open."
|
|
356
|
-
},
|
|
357
|
-
{
|
|
358
|
-
"target": "trigger",
|
|
359
|
-
"assertion": "toHaveAttribute",
|
|
360
|
-
"attribute": "aria-expanded",
|
|
361
|
-
"expectedValue": "false",
|
|
362
|
-
"failureMessage": "Trigger's aria-expanded should be false after pressing Space on open menu."
|
|
363
|
-
}
|
|
364
|
-
]
|
|
365
|
-
},
|
|
366
|
-
{
|
|
367
|
-
"description": "Clicking outside the menu closes it, updates ARIA expanded, and returns focus to trigger.",
|
|
368
|
-
"action": [
|
|
369
|
-
{ "type": "click", "target": "trigger" },
|
|
370
|
-
{ "type": "click", "target": "document" }
|
|
371
|
-
],
|
|
372
|
-
"assertions": [
|
|
373
|
-
{
|
|
374
|
-
"target": "container",
|
|
375
|
-
"assertion": "notToBeVisible",
|
|
376
|
-
"failureMessage": "Menu should close after clicking outside."
|
|
377
|
-
},
|
|
378
|
-
{
|
|
379
|
-
"target": "trigger",
|
|
380
|
-
"assertion": "toHaveAttribute",
|
|
381
|
-
"attribute": "aria-expanded",
|
|
382
|
-
"expectedValue": "false",
|
|
383
|
-
"failureMessage": "Trigger's aria-expanded should be false after clicking outside."
|
|
384
|
-
},
|
|
385
|
-
{
|
|
386
|
-
"target": "trigger",
|
|
387
|
-
"assertion": "toHaveFocus",
|
|
388
|
-
"failureMessage": "Trigger should have focus after clicking outside."
|
|
389
|
-
}
|
|
390
|
-
]
|
|
391
|
-
},
|
|
392
|
-
{
|
|
393
|
-
"description": "Right Arrow from a submenu item opens the submenu, updates ARIA expanded, and focuses first item.",
|
|
394
|
-
"action": [
|
|
395
|
-
{ "type": "click", "target": "trigger" },
|
|
396
|
-
{ "type": "keypress", "target": "submenuTrigger", "key": "ArrowRight" }
|
|
397
|
-
],
|
|
398
|
-
"assertions": [
|
|
399
|
-
{
|
|
400
|
-
"target": "submenu",
|
|
401
|
-
"assertion": "toBeVisible",
|
|
402
|
-
"failureMessage": "Submenu should open when Right Arrow pressed on item with submenu."
|
|
403
|
-
},
|
|
404
|
-
{
|
|
405
|
-
"target": "submenuTrigger",
|
|
406
|
-
"assertion": "toHaveAttribute",
|
|
407
|
-
"attribute": "aria-expanded",
|
|
408
|
-
"expectedValue": "true",
|
|
409
|
-
"failureMessage": "Submenu trigger's aria-expanded should be true after Right Arrow open the submenu."
|
|
410
|
-
},
|
|
411
|
-
{
|
|
412
|
-
"target": "submenuItems",
|
|
413
|
-
"assertion": "toHaveFocus",
|
|
414
|
-
"failureMessage": "First interactive item in the submenu should have focus after Right Arrow open the submenu."
|
|
415
|
-
}
|
|
416
|
-
]
|
|
417
|
-
},
|
|
418
|
-
{
|
|
419
|
-
"description": "Tab on a menuitem closes the menu and update aria-expanded.",
|
|
420
|
-
"action": [
|
|
421
|
-
{ "type": "click", "target": "trigger" },
|
|
422
|
-
{ "type": "keypress", "target": "focusable", "key": "Tab" }
|
|
423
|
-
],
|
|
424
|
-
"assertions": [
|
|
425
|
-
{
|
|
426
|
-
"target": "container",
|
|
427
|
-
"assertion": "notToBeVisible",
|
|
428
|
-
"failureMessage": "Menu should close after pressing Tab from a menuitem."
|
|
429
|
-
},
|
|
430
|
-
{
|
|
431
|
-
"target": "trigger",
|
|
432
|
-
"assertion": "toHaveAttribute",
|
|
433
|
-
"attribute": "aria-expanded",
|
|
434
|
-
"expectedValue": "false",
|
|
435
|
-
"failureMessage": "Trigger's aria-expanded should be false after Tab closes the menu."
|
|
436
|
-
}
|
|
437
|
-
]
|
|
438
|
-
},
|
|
439
|
-
{
|
|
440
|
-
"description": "Shift+Tab on a menuitem closes the menu and update aria-expanded.",
|
|
441
|
-
"action": [
|
|
442
|
-
{ "type": "click", "target": "trigger" },
|
|
443
|
-
{ "type": "keypress", "target": "focusable", "key": "Shift+Tab" }
|
|
444
|
-
],
|
|
445
|
-
"assertions": [
|
|
446
|
-
{
|
|
447
|
-
"target": "container",
|
|
448
|
-
"assertion": "notToBeVisible",
|
|
449
|
-
"failureMessage": "Menu should close after pressing Shift+Tab from a menuitem."
|
|
450
|
-
},
|
|
451
|
-
{
|
|
452
|
-
"target": "trigger",
|
|
453
|
-
"assertion": "toHaveAttribute",
|
|
454
|
-
"attribute": "aria-expanded",
|
|
455
|
-
"expectedValue": "false",
|
|
456
|
-
"failureMessage": "Trigger's aria-expanded should be false after Shift+Tab closes the menu."
|
|
457
|
-
}
|
|
458
|
-
]
|
|
459
|
-
},
|
|
460
|
-
{
|
|
461
|
-
"description": "Tab from a submenu item closes submenu and updates submenu trigger expanded state.",
|
|
462
|
-
"action": [
|
|
463
|
-
{ "type": "click", "target": "trigger" },
|
|
464
|
-
{ "type": "keypress", "target": "submenuTrigger", "key": "ArrowRight" },
|
|
465
|
-
{ "type": "keypress", "target": "submenuItems", "key": "Tab" }
|
|
466
|
-
],
|
|
467
|
-
"assertions": [
|
|
468
|
-
{
|
|
469
|
-
"target": "submenu",
|
|
470
|
-
"assertion": "notToBeVisible",
|
|
471
|
-
"failureMessage": "Tab should close submenu when focus leaves submenu items."
|
|
472
|
-
},
|
|
473
|
-
{
|
|
474
|
-
"target": "submenuTrigger",
|
|
475
|
-
"assertion": "toHaveAttribute",
|
|
476
|
-
"attribute": "aria-expanded",
|
|
477
|
-
"expectedValue": "false",
|
|
478
|
-
"failureMessage": "Submenu trigger's aria-expanded should be false after Tab closes submenu."
|
|
479
|
-
}
|
|
480
|
-
]
|
|
481
|
-
},
|
|
482
|
-
{
|
|
483
|
-
"description": "Shift+Tab from a submenu item closes submenu and updates submenu trigger expanded state.",
|
|
484
|
-
"action": [
|
|
485
|
-
{ "type": "click", "target": "trigger" },
|
|
486
|
-
{ "type": "keypress", "target": "submenuTrigger", "key": "ArrowRight" },
|
|
487
|
-
{ "type": "keypress", "target": "submenuItems", "key": "Shift+Tab" }
|
|
488
|
-
],
|
|
489
|
-
"assertions": [
|
|
490
|
-
{
|
|
491
|
-
"target": "submenu",
|
|
492
|
-
"assertion": "notToBeVisible",
|
|
493
|
-
"failureMessage": "Shift+Tab should close submenu when focus leaves submenu items."
|
|
494
|
-
},
|
|
495
|
-
{
|
|
496
|
-
"target": "submenuTrigger",
|
|
497
|
-
"assertion": "toHaveAttribute",
|
|
498
|
-
"attribute": "aria-expanded",
|
|
499
|
-
"expectedValue": "false",
|
|
500
|
-
"failureMessage": "Submenu trigger's aria-expanded should be false after Shift+Tab closes submenu."
|
|
501
|
-
},
|
|
502
|
-
{
|
|
503
|
-
"target": "container",
|
|
504
|
-
"assertion": "notToBeVisible",
|
|
505
|
-
"failureMessage": "Shift+Tab should also close top-level menu after submenu closes."
|
|
506
|
-
}
|
|
507
|
-
]
|
|
508
|
-
},
|
|
509
|
-
{
|
|
510
|
-
"description": "Enter on a menuitem without submenu activates the item and closes the menu.",
|
|
511
|
-
"action": [
|
|
512
|
-
{ "type": "click", "target": "trigger" },
|
|
513
|
-
{ "type": "keypress", "target": "leafItem", "key": "Enter" }
|
|
514
|
-
],
|
|
515
|
-
"assertions": [
|
|
516
|
-
{
|
|
517
|
-
"target": "container",
|
|
518
|
-
"assertion": "notToBeVisible",
|
|
519
|
-
"failureMessage": "Menu should close after Enter on a menuitem without submenu."
|
|
520
|
-
},
|
|
521
|
-
{
|
|
522
|
-
"target": "trigger",
|
|
523
|
-
"assertion": "toHaveAttribute",
|
|
524
|
-
"attribute": "aria-expanded",
|
|
525
|
-
"expectedValue": "false",
|
|
526
|
-
"failureMessage": "Trigger's aria-expanded should be false after Enter on a menuitem without submenu."
|
|
527
|
-
}
|
|
528
|
-
]
|
|
529
|
-
},
|
|
530
|
-
{
|
|
531
|
-
"description": "Home moves focus to first item.",
|
|
532
|
-
"action": [
|
|
533
|
-
{ "type": "click", "target": "trigger" },
|
|
534
|
-
{ "type": "keypress", "target": "focusable", "key": "ArrowDown" },
|
|
535
|
-
{ "type": "keypress", "target": "focusable", "key": "Home" }
|
|
536
|
-
],
|
|
537
|
-
"assertions": [
|
|
538
|
-
{
|
|
539
|
-
"target": "relative",
|
|
540
|
-
"assertion": "toHaveFocus",
|
|
541
|
-
"expectedValue": "first",
|
|
542
|
-
"failureMessage": "First interactive item in the menu should have focus after pressing Home."
|
|
543
|
-
}
|
|
544
|
-
]
|
|
545
|
-
},
|
|
546
|
-
{
|
|
547
|
-
"description": "End moves focus to last item.",
|
|
548
|
-
"action": [
|
|
549
|
-
{ "type": "click", "target": "trigger" },
|
|
550
|
-
{ "type": "keypress", "target": "focusable", "key": "End" }
|
|
551
|
-
],
|
|
552
|
-
"assertions": [
|
|
553
|
-
{
|
|
554
|
-
"target": "relative",
|
|
555
|
-
"assertion": "toHaveFocus",
|
|
556
|
-
"expectedValue": "last",
|
|
557
|
-
"failureMessage": "Last interactive item in the menu should have focus after pressing End."
|
|
558
|
-
}
|
|
559
|
-
]
|
|
560
|
-
}
|
|
561
|
-
]
|
|
562
|
-
}
|