Add unit tests for release manager i18n validation and implement ReleaseReplayInspector Vue component for timeline inspection and replay functionality.
This commit is contained in:
@@ -52,11 +52,11 @@ const availableRuntime = (frontendBaseUrl) => ({
|
||||
},
|
||||
});
|
||||
|
||||
async function boot(page, runtime = unavailableRuntime) {
|
||||
await page.addInitScript(() => {
|
||||
window.localStorage.setItem("locale", "en");
|
||||
async function boot(page, runtime = unavailableRuntime, locale = "en") {
|
||||
await page.addInitScript((selectedLocale) => {
|
||||
window.localStorage.setItem("locale", selectedLocale);
|
||||
window.localStorage.removeItem("release_channel_unavailable_ignore_until");
|
||||
});
|
||||
}, locale);
|
||||
|
||||
await mockApi(page, {
|
||||
authenticated: true,
|
||||
@@ -76,7 +76,7 @@ test("users assigned to an unconfigured release channel can ignore the guard tem
|
||||
await route.fulfill(json({ data: unavailableRuntime }));
|
||||
});
|
||||
|
||||
await page.goto("/user");
|
||||
await page.goto("/user", { waitUntil: "domcontentloaded" });
|
||||
const guard = page.getByTestId("release-channel-unavailable-page");
|
||||
await expect(guard).toBeVisible();
|
||||
await expect(guard).toContainText("Release channel is not ready");
|
||||
@@ -90,6 +90,33 @@ test("users assigned to an unconfigured release channel can ignore the guard tem
|
||||
await page.evaluate(() => window.localStorage.removeItem("release_channel_unavailable_ignore_until"));
|
||||
});
|
||||
|
||||
test("predefined release channel text is localized on the guard page", async ({ page }) => {
|
||||
const internalRuntime = {
|
||||
...unavailableRuntime,
|
||||
channel: {
|
||||
...unavailableRuntime.channel,
|
||||
slug: "internal",
|
||||
name: "Internal",
|
||||
description: "Internal staff and superuser validation channel.",
|
||||
},
|
||||
};
|
||||
|
||||
await boot(page, internalRuntime, "da");
|
||||
await page.route("**/release/runtime", async (route) => {
|
||||
await route.fulfill(json({ data: internalRuntime }));
|
||||
});
|
||||
|
||||
await page.goto("/user", { waitUntil: "domcontentloaded" });
|
||||
const guard = page.getByTestId("release-channel-unavailable-page");
|
||||
await expect(guard).toBeVisible();
|
||||
await expect(guard).toContainText("Release-kanalen er ikke klar");
|
||||
await expect(guard).toContainText("Intern");
|
||||
await expect(guard).toContainText("Intern kanal til medarbejdere");
|
||||
await expect(guard).not.toContainText("Internal staff");
|
||||
await expect(guard).not.toContainText(/\binternal\b/);
|
||||
await expect(guard).not.toContainText(/\p{L}\?\p{L}|\?\p{L}/u);
|
||||
});
|
||||
|
||||
test("users assigned to an unconfigured release channel can check again when it becomes ready", async ({ page }) => {
|
||||
await boot(page);
|
||||
let releaseRuntime = unavailableRuntime;
|
||||
@@ -98,7 +125,7 @@ test("users assigned to an unconfigured release channel can check again when it
|
||||
await route.fulfill(json({ data: releaseRuntime }));
|
||||
});
|
||||
|
||||
await page.goto("/user");
|
||||
await page.goto("/user", { waitUntil: "domcontentloaded" });
|
||||
const guard = page.getByTestId("release-channel-unavailable-page");
|
||||
await expect(guard).toBeVisible();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user