Files
authentik/web/test/browser/modals.test.ts
Teffen Ellis b88d082947 web/a11y: Modals, Command Palette (Merge branch) (#17812)
* Use project relative paths.

* Fix tests.

* Fix types.

* Clean up admin imports.

* Move admin import.

* Remove or replace references to admin.

* Typo fix.

* Flesh out ak-modal, about modal.

* Flesh out lazy modal.

* Fix portal elements not using dialog scope.

* Fix url parameters, wizards.

* Fix invokers, lazy load.

* Fix theming.

* Add placeholders, help.

* Flesh out command palette.

Flesh out styles, command invokers.

Continue clean up.

Allow slotted content.

Flesh out.

* Flesh out edit invoker. Prep groups.

* Fix odd labeling, legacy situations.

* Prepare deprecation of table modal. Clean up serialization.

* Tidy types.

* Port provider select modal.

* Port member select form.

* Flesh out role modal. Fix loading state.

* Port user group form.

* Fix spellcheck.

* Fix dialog detection.

* Revise types.

* Port rac launch modal.

* Remove deprecated table modal.

* Consistent form action placement.

* Consistent casing.

* Consistent alignment.

* Use more appropriate description.

* Flesh out icon. Fix alignment, colors.

* Flesh out user search.

* Consistent save button.

* Clean up labels.

* Reduce warning noise.

* Clean up label.

* Use attribute e2e expects.

* Use directive. Fix lifecycle

* Fix frequent un-memoized entries.

* Fix up closedBy detection.

* Tidy alignment.

* Fix types, composition.

* Fix labels, tests.

* Fix up impersonation, labels.

* Flesh out. Fix refresh after submit.

* Flesh out basic modal test.

* Fix ARIA.

* Flesh out roles test.

* Revise selectors.

* Clean up selectors.

* Fix impersonation labels, form references.

* Fix messages appearing under modals.

* Ensure reason is parsed.

* Flesh out impersonation test.

* Flesh out impersonate test.

* Flesh out application tests. Clean up toolbar header, ARIA.

* Flesh out wizard test.

* Refine weight, order.

* Fix up initial values, selectors.

* Fix tests.

* Fix selector.
2026-03-25 06:07:29 +00:00

56 lines
1.8 KiB
TypeScript

import { expect, test } from "#e2e";
test.describe("Modals", () => {
test.beforeEach("Authenticate", async ({ session }) => {
await session.login({
to: "/if/admin/",
});
});
test("About authentik modal", async ({ page }) => {
const aboutButton = page
.getByRole("contentinfo", { name: "authentik information" })
.getByRole("button", { name: "Open about dialog" });
await expect(aboutButton, "About button is visible").toBeVisible();
const aboutDialog = page.getByRole("dialog", { name: "About authentik" });
await expect(aboutDialog, "About dialog is initially closed").toBeHidden();
await aboutButton.click();
await expect(aboutDialog, "About dialog opens").toBeVisible();
await test.step("Verify content loads", async () => {
const definitionList = aboutDialog.getByRole("definition");
// Wait for the API data to load (replaces the loading spinner)
await definitionList.first().waitFor({ state: "visible" });
// Verify key entries are present
await expect(
aboutDialog.getByText("UI Version"),
"Version label is visible",
).toBeVisible();
});
await test.step("Close dialog", async () => {
const closeButton = aboutDialog.getByRole("button", { name: "Close dialog" });
await closeButton.click();
await expect(aboutDialog, "About dialog closes").toBeHidden();
});
await test.step("Dialog removed from DOM", async () => {
const dialogElement = page.locator("dialog:has(ak-about-modal)");
await expect(
dialogElement,
"Dialog element is removed from the DOM after close",
).toHaveCount(0);
});
});
});