Stability round two: no language links on POST-rendered pages, scoped observers, Vary only where it varies
CI / full-gate (push) Successful in 2m37s

This commit is contained in:
2026-08-04 00:10:31 +02:00
parent be3bc2bdbb
commit 93139ea058
11 changed files with 66 additions and 21 deletions
+7
View File
@@ -8,6 +8,7 @@ const request = (overrides: Partial<I18nRequest> = {}): I18nRequest => ({
locale: "sv-SE",
localeHref: (href) => href,
locales: ["en-US", "sv-SE"],
method: "GET",
t: ENGLISH,
url: new URL("http://localhost/admin/users?q=ada"),
...overrides,
@@ -30,3 +31,9 @@ test("dir follows the locale's script", () => {
assert.equal(i18nLocals(request()).dir, "ltr");
assert.equal(i18nLocals(request({ locale: "ar-EG" })).dir, "rtl");
});
test("a page rendered from a POST offers no language links — that URL may have no GET at all", () => {
// Following one would dead-end on a 405 (a POST-only route), or silently discard a re-rendered
// form's input. The picker renders nothing below two choices, so an empty list hides it.
assert.deepEqual(i18nLocals(request({ method: "POST" })).localeSwitch, []);
});