FIX: Focus first button in topic admin menu (#10562)

When using Shift+A to toggle the admin menu for a topic the first button was not focused, so the menu could not be navigated with tab.
This commit is contained in:
Martin Brennan
2020-09-01 10:29:35 +10:00
committed by GitHub
parent 5ec5fbd7ba
commit 594d919d22
2 changed files with 23 additions and 0 deletions

View File

@@ -34,3 +34,16 @@ QUnit.test(
);
}
);
QUnit.test("Toggle the menu as admin focuses the first item", async assert => {
updateCurrentUser({ admin: true });
await visit("/t/internationalization-localization/280");
assert.ok(exists("#topic"), "The topic was rendered");
await click(".toggle-admin-menu");
assert.equal(
document.activeElement,
document.querySelector(".topic-admin-multi-select > button")
);
});