Commit 95b68fa
authored
test(context): cover NodeList for include/exclude and fix doc examples (#5178)
The `context.md` examples labeled "Test a Node list" and "Test
everything except these DOM nodes" used `document.querySelector(...)`,
which only ever returns a single node, so they didn't actually show a
NodeList. Switched both to `document.querySelectorAll(...)` and tweaked
the comments so the examples demonstrate the NodeList support that
already works. Also added two `Context` unit tests: one for a NodeList
passed as the bare context, and one for NodeLists passed via
`include`/`exclude`. (`doc/API.md` already lists NodeList as an accepted
context, so it didn't need a change.)
Heads up: I couldn't get the browser test runner going in my
environment, so the new assertions were checked against the built
`axe.js` bundle under jsdom rather than web-test-runner — prettier and
eslint are clean. Worth a CI run to confirm in-browser.
Closes: #33481 parent 26acf27 commit 95b68fa
2 files changed
Lines changed: 25 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | | - | |
| 46 | + | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
77 | | - | |
| 76 | + | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
199 | 209 | | |
200 | 210 | | |
201 | 211 | | |
| |||
261 | 271 | | |
262 | 272 | | |
263 | 273 | | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
264 | 285 | | |
265 | 286 | | |
266 | 287 | | |
| |||
0 commit comments