Reminder tests own their VAPID state (the gate runs with keys set)
The deploy gate runs the suites against a release that reads the production env — which now carries VAPID keys — so phase 2's "reminders are hidden without VAPID" check failed there and the gate (correctly) refused to switch. That check now runs on its own instance with VAPID_PUBLIC_KEY/_PRIVATE_KEY forced empty, so it pins the unconfigured state whatever the operator's env holds. Verified twice: with no VAPID in the environment and with keys exported exactly like the deploy shell does (83 checks both ways).
This commit is contained in:
parent
77819b5961
commit
d72b335965
2 changed files with 34 additions and 17 deletions
|
|
@ -477,23 +477,40 @@ const browser = await launchBrowser();
|
|||
await context.close();
|
||||
}
|
||||
|
||||
/* 4. reminders hidden without VAPID ---------------------------------- */
|
||||
/* 4. reminders hidden without VAPID ----------------------------------
|
||||
Its own instance, with the VAPID variables forced empty: an operator's env
|
||||
(production's, or the deploy gate's release) may well have keys, and this
|
||||
check is about the state where reminders do not exist at all. */
|
||||
{
|
||||
const { context, page } = await makePage(browser);
|
||||
await seed(page, { decks: [] });
|
||||
await page.goto(BASE, { waitUntil: "networkidle" });
|
||||
await page.waitForTimeout(800);
|
||||
const status = await page.evaluate(async () => {
|
||||
const response = await fetch("/api/push", { headers: { "x-ollama-key": "test-key" } });
|
||||
return { status: response.status, body: await response.json() };
|
||||
check("push: hidden-state port is free", !(await portInUse(3215)));
|
||||
const app = spawnApp(3215, {
|
||||
VAPID_PUBLIC_KEY: "",
|
||||
VAPID_PRIVATE_KEY: "",
|
||||
PUSH_DIR: path.join(REPO, "tests", ".tmp", "push-off"),
|
||||
});
|
||||
check("push: status says disabled without VAPID", status.body.enabled === false, JSON.stringify(status.body));
|
||||
await page.locator("nav.tabbar").getByRole("button").click();
|
||||
await page.getByRole("dialog").waitFor({ timeout: 6000 });
|
||||
await page.waitForTimeout(500);
|
||||
check("push: daily goal setting visible", await page.getByText("Daily goal").isVisible());
|
||||
check("push: reminder UI hidden", (await page.getByText("Daily reminder").count()) === 0);
|
||||
await context.close();
|
||||
try {
|
||||
const up = await waitForHttp("http://127.0.0.1:3215/api/health");
|
||||
check("push: instance without VAPID is up", up);
|
||||
if (up) {
|
||||
const { context, page } = await makePage(browser);
|
||||
await seed(page, { decks: [] });
|
||||
await page.goto("http://127.0.0.1:3215/", { waitUntil: "networkidle" });
|
||||
await page.waitForTimeout(800);
|
||||
const status = await page.evaluate(async () => {
|
||||
const response = await fetch("/api/push", { headers: { "x-ollama-key": "test-key" } });
|
||||
return { status: response.status, body: await response.json() };
|
||||
});
|
||||
check("push: status says disabled without VAPID", status.body.enabled === false, JSON.stringify(status.body));
|
||||
await page.locator("nav.tabbar").getByRole("button").click();
|
||||
await page.getByRole("dialog").waitFor({ timeout: 6000 });
|
||||
await page.waitForTimeout(500);
|
||||
check("push: daily goal setting visible", await page.getByText("Daily goal").isVisible());
|
||||
check("push: reminder UI hidden", (await page.getByText("Daily reminder").count()) === 0);
|
||||
await context.close();
|
||||
}
|
||||
} finally {
|
||||
app.stop();
|
||||
}
|
||||
}
|
||||
|
||||
/* 5. reminders with VAPID: status, subscribe, delete, test send ------ */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue