Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions frontend/e2e/health-check.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* E2E: Health check endpoint verification
*
* Tests that:
* 1. GET /api/health returns 200 with { status: "ok" }
* 2. The endpoint is publicly accessible (no auth required)
*/

import { test, expect } from "@playwright/test";

test.describe("Health Check Endpoint", () => {
test("GET /api/health returns status ok", async ({ request }) => {
const response = await request.get("/api/health");

expect(response.status()).toBe(200);

const body = await response.json();
expect(body).toEqual({ status: "ok" });
});

test("health endpoint is accessible without authentication", async ({
request,
}) => {
// Make request without any auth headers/cookies
const response = await request.get("/api/health", {
headers: {},
});

expect(response.status()).toBe(200);
const body = await response.json();
expect(body.status).toBe("ok");
});
});
5 changes: 5 additions & 0 deletions frontend/src/app/api/health/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { NextResponse } from "next/server";

export async function GET() {
return NextResponse.json({ status: "ok" });
}
1 change: 1 addition & 0 deletions frontend/src/lib/auth/mode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ export const ROUTE_CONFIG = {
"/register",
"/verify-request", // For email magic link
"/api/auth",
"/api/health",
"/pending-approval",
"/account-suspended",
],
Expand Down
Loading