feat(ops): add database readiness probe
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user