Commit 9c2ca2e
committed
MAINT: fix flaky CreateTargetDialog accessibility test
Fluent's Dropdown focus modalizer (tabster) puts aria-hidden on the
dialog's ancestors while the listbox popover is open, and under jsdom it
is not reliably restored when the listbox closes. The existing
restoreDialogAccessibility() helper stripped it as a one-shot snapshot at
the end of selectTargetType(), so any aria-hidden re-applied afterwards
(e.g. on a later focus change) left every subsequent *ByRole query blind
- *ByRole defaults to hidden: false. That is what made "should keep full
long registry names accessible after selecting RoundRobin targets" fail
intermittently in CI while the *ByLabelText assertion just above it
passed.
Replace the point-in-time cleanup with a MutationObserver installed per
test that re-runs the cleanup whenever aria-hidden reappears above the
dialog. The helper is now a no-op while a listbox is open, so the
modalizer keeps its real behavior and only the missing restore is
compensated for. Assertions are unchanged - the Remove button is still
required to be reachable by role.
Verified by re-adding aria-hidden to a dialog ancestor from a timer
before the failing assertion: reproduces the exact CI error without the
observer, passes with it. Suite run 15x with no failures.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 48ec2fc7-3fd7-4188-a3ff-df3cc2a647901 parent 981e6cd commit 9c2ca2e
1 file changed
Lines changed: 29 additions & 3 deletions
Lines changed: 29 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
92 | | - | |
93 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
104 | 107 | | |
105 | 108 | | |
106 | 109 | | |
| 110 | + | |
107 | 111 | | |
108 | 112 | | |
109 | 113 | | |
| |||
112 | 116 | | |
113 | 117 | | |
114 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
115 | 134 | | |
116 | 135 | | |
117 | 136 | | |
| |||
198 | 217 | | |
199 | 218 | | |
200 | 219 | | |
| 220 | + | |
| 221 | + | |
201 | 222 | | |
| 223 | + | |
202 | 224 | | |
203 | 225 | | |
204 | 226 | | |
| |||
207 | 229 | | |
208 | 230 | | |
209 | 231 | | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
210 | 236 | | |
211 | 237 | | |
212 | 238 | | |
| |||
0 commit comments