fix(ui): simplify login and suppress pointer focus ring on locale select

This commit is contained in:
Codex
2026-09-13 15:57:57 +02:00
parent 7d826e46c0
commit 45db3a239b
7 changed files with 93 additions and 9 deletions
+34
View File
@@ -162,6 +162,40 @@ for (const width of [390, 1280]) {
});
}
for (const locale of ["en", "it"]) {
test(`login keeps only the main title in ${locale}`, async ({ page }, testInfo) => {
await fixtures(page);
await page.route("**/config.js", route => route.fulfill({ contentType: "application/javascript",
body: `window.__THOTHII_CONFIG__ = ${JSON.stringify({ backendBaseUrl: "/api", shell: { mode: "full", defaultLocale: locale } })};` }));
await page.route("**/api/auth/config", route => route.fulfill({ json: { mode: "local", localLogin: true, oidcLogin: false } }));
await page.route("**/api/me", route => route.fulfill({ status: 401, json: { code: "unauthenticated" } }));
await page.goto("/");
await expect(page.getByRole("heading", { name: locale === "it" ? "Accedi a ThothII" : "Sign in to ThothII" })).toBeVisible();
await expect(page.getByText(locale === "it" ? "Accesso a ThothII" : "ThothII access", { exact: true })).toHaveCount(0);
await expect(page.getByText(locale === "it" ? "Usa l’account della tua installazione per continuare." : "Use your installation account to continue.", { exact: true })).toHaveCount(0);
await page.screenshot({ path: testInfo.outputPath(`login-${locale}.png`), animations: "disabled" });
});
}
test("language selector has no pointer ring and retains keyboard focus in both themes", async ({ page }, testInfo) => {
await fixtures(page);
await page.goto("/");
const language = page.getByRole("combobox", { name: "Interface language" });
for (const theme of ["light", "dark"]) {
if (theme === "dark") await page.getByRole("button", { name: "Use dark theme", exact: true }).click();
await language.click();
await page.keyboard.press("Escape");
await expect(language).toBeFocused();
await expect(language).toHaveCSS("outline-style", "none");
await expect(language).toHaveCSS("box-shadow", "none");
await page.screenshot({ path: testInfo.outputPath(`language-pointer-${theme}.png`), animations: "disabled" });
await page.keyboard.press("Tab");
await page.keyboard.press("Shift+Tab");
await expect(language).toBeFocused();
await expect(language).toHaveCSS("outline-style", "solid");
}
});
for (const route of ["/", "/?thoth_route=administration%2Fdatabase"]) {
test(`Core prompt remains readable after loading ${route}`, async ({ page }, testInfo) => {
const writes = await fixtures(page);