Commit 563aa5e
committed
fix(tests): Make tabNavigateToWorkspace idempotent
Previously this function would just send a bunch of tabs, which
depended on focus state being as-on-document-load. Some tests
(notably the ones in basic_test.ts) that have only a suiteSetup
and not a (per-test) setup method were only were only passing
because of the combination of:
* Due to issue #632, pressing tab when the workspace is focused
(and there are no further focusable elements on the page)
incorrectly causes focus to move to the first focusable element
on the page instead of (as would normally be the case) to the
browser controls, and
* The fact that the index.html had exactly one additional focusable
div on the page, preceding the injection div.
This meant that calling tabNavigateToWorkspace when the workspace
was already focused would, only by sheer coincidence, result in the
focus remaining on the workspace.
By explicitly focusing a known element, tabNavigateToWorkspace
should work correctly regardless of how many focusable elements
are on the page and which one (if any) was focused before the call.1 parent 0d726a2 commit 563aa5e
1 file changed
+8
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
455 | 455 | | |
456 | 456 | | |
457 | 457 | | |
458 | | - | |
459 | | - | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
460 | 466 | | |
461 | 467 | | |
462 | 468 | | |
| |||
0 commit comments