mirror of
https://github.com/discourse/discourse.git
synced 2025-01-29 05:20:45 +08:00
DEV: use isFocused dom helper (#30533)
This commit is contained in:
parent
a21eefd142
commit
35f8b1d5d3
|
@ -366,10 +366,7 @@ module("Integration | Component | FloatKit | d-menu", function (hooks) {
|
||||||
await triggerKeyEvent(document.activeElement, "keydown", "Tab");
|
await triggerKeyEvent(document.activeElement, "keydown", "Tab");
|
||||||
await triggerKeyEvent(document.activeElement, "keydown", "Enter");
|
await triggerKeyEvent(document.activeElement, "keydown", "Enter");
|
||||||
|
|
||||||
assert.strictEqual(
|
assert.dom(".fk-d-menu__trigger").isFocused();
|
||||||
document.activeElement,
|
|
||||||
document.querySelector(".fk-d-menu__trigger")
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test("focusTrigger=false on close", async function (assert) {
|
test("focusTrigger=false on close", async function (assert) {
|
||||||
|
@ -387,6 +384,6 @@ module("Integration | Component | FloatKit | d-menu", function (hooks) {
|
||||||
await triggerKeyEvent(document.activeElement, "keydown", "Tab");
|
await triggerKeyEvent(document.activeElement, "keydown", "Tab");
|
||||||
await triggerKeyEvent(document.activeElement, "keydown", "Enter");
|
await triggerKeyEvent(document.activeElement, "keydown", "Enter");
|
||||||
|
|
||||||
assert.strictEqual(document.activeElement, document.body);
|
assert.dom(document.body).isFocused();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user