feat(ops): add database readiness probe

This commit is contained in:
cesnimda
2026-08-31 11:54:36 +02:00
parent 2f146f743c
commit b9e703ee7c
6 changed files with 56 additions and 2 deletions
+11
View File
@@ -57,6 +57,17 @@ test.beforeEach(async ({ page }) => {
await page.addInitScript(() => window.localStorage.setItem("uiLanguage", "en"));
});
test("API liveness and database readiness are separate public probes", async ({ request }) => {
const origin = apiUrl.replace(/\/api$/, "");
const liveness = await request.get(`${origin}/health`);
const readiness = await request.get(`${origin}/ready`);
expect(liveness.status()).toBe(200);
expect(await liveness.json()).toMatchObject({ status: "ok" });
expect(readiness.status()).toBe(200);
expect(await readiness.json()).toEqual({ status: "ready" });
});
test("public plans stay honest, responsive and keyboard accessible", async ({ page }) => {
for (const scheme of ["light", "dark"] as const) {
await page.addInitScript((value) => window.localStorage.setItem("jobtracker.themeMode", value), scheme);