Skip to content

Commit

Permalink
Add delay for accessibility node list to be populated
Browse files Browse the repository at this point in the history
Looks like there are some internal (to Chromium) changes when `aria-expanded` state changes, but adding a 100ms delay from Accordion button `.click()` to calling `page.accessibility.snapshot()` fixes the child node loop ✅

Lots of commits landing so may not need this workaround in future:

* chromium/chromium@08fed96
* chromium/chromium@c7fae74
* chromium/chromium@06f376b
* chromium/chromium@86543a2

Another one ongoing to stablise accessibility objects:
https://chromium-review.googlesource.com/c/chromium/src/+/4027071
  • Loading branch information
colinrotherham committed Dec 8, 2022
1 parent 68e7715 commit af91aae
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/govuk/components/accordion/accordion.test.js
Expand Up @@ -256,6 +256,7 @@ describe('/components/accordion', () => {
)

await $element.click()
await page.waitForTimeout(100)

await expect(getAccessibleName(page, $element)).resolves.toBe(
'Section A , Hide this section'
Expand All @@ -274,6 +275,7 @@ describe('/components/accordion', () => {
)

await $element.click()
await page.waitForTimeout(100)

await expect(getAccessibleName(page, $element)).resolves.toBe(
'Test , Additional description , Hide this section'
Expand Down

0 comments on commit af91aae

Please sign in to comment.