mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 09:42:21 +00:00
Let a quick second click on Next move on, and Tab leave the welcome for the page
The second click of a double click on NEXT was dropped, so the button looked dead; it now moves to the next step, and only the launch itself still takes a single click. Tab from the search bar or another control jumped back into the card; the card no longer claims focus from the page, and still takes it when focus has nowhere else to be. Co-authored-by: Manjunath Paparaju <[email protected]>
This commit is contained in:
1 parent
4d42c56bdf
commit
866eadbe5e
6 files changed
+77
-6
No files matched your search
@@ -152,6 +152,37 @@ test('the card is hidden until initialized, then revealed with its copy', async
|
||||
);
|
||||
});
|
||||
|
||||
test('a quick second click on NEXT moves on, and never launches', async (t) => {
|
||||
let calls = 0;
|
||||
const { root, frames } = await launch(t, {
|
||||
dataManager: {
|
||||
setEnabled: async () => {
|
||||
calls++;
|
||||
return true;
|
||||
},
|
||||
},
|
||||
});
|
||||
const primary = root.querySelector('[data-first-run-primary]');
|
||||
const press = (detail) => {
|
||||
primary.dispatchEvent(new PointerEvent('pointerdown', { bubbles: true }));
|
||||
primary.dispatchEvent(new MouseEvent('click', { bubbles: true, detail }));
|
||||
};
|
||||
press(1);
|
||||
await settle(frames);
|
||||
assert.ok(root.querySelector('[data-first-run-start]'), 'on the second step');
|
||||
// The second click of a double click, after the step settled, moves on.
|
||||
press(2);
|
||||
await settle(frames);
|
||||
assert.equal(primary.dataset.firstRunChoice, 'explore', 'on the last step');
|
||||
press(2);
|
||||
await settle(frames);
|
||||
assert.equal(calls, 0);
|
||||
assert.equal(root.dataset.state ?? null, null, 'a double click never starts');
|
||||
press(1);
|
||||
await settle(frames);
|
||||
assert.ok(root.dataset.state, 'a single click starts');
|
||||
});
|
||||
|
||||
test('a busy mission marks the choices aria-disabled, never disabled', async (t) => {
|
||||
let finish;
|
||||
let calls = 0;
|
||||
|
||||
Reference in new issue
Block a user