Add folder game, file browser UI, and automated tests.
Introduces a localStorage-backed messy-desktop challenge with sub-steps, drag-and-drop and Places/Back navigation, IBM Plex Mono, and a /api/health endpoint. Adds Vitest coverage for the API and level logic plus Playwright smoke tests. Made-with: Cursor
This commit is contained in:
11
tests/api/health-route.test.ts
Normal file
11
tests/api/health-route.test.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { GET } from "~/app/api/health/route";
|
||||
|
||||
describe("GET /api/health", () => {
|
||||
it("returns 200 and status ok", async () => {
|
||||
const res = await GET();
|
||||
expect(res.status).toBe(200);
|
||||
await expect(res.json()).resolves.toEqual({ status: "ok" });
|
||||
});
|
||||
});
|
||||
21
tests/api/post-hello.test.ts
Normal file
21
tests/api/post-hello.test.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
|
||||
vi.mock("~/server/auth", () => ({
|
||||
auth: vi.fn(async () => null),
|
||||
}));
|
||||
|
||||
vi.mock("~/server/db", () => ({
|
||||
db: {},
|
||||
}));
|
||||
|
||||
import { createCaller } from "~/server/api/root";
|
||||
import { createTRPCContext } from "~/server/api/trpc";
|
||||
|
||||
describe("tRPC post.hello", () => {
|
||||
it("returns a greeting for the given text", async () => {
|
||||
const ctx = await createTRPCContext({ headers: new Headers() });
|
||||
const caller = createCaller(ctx);
|
||||
const out = await caller.post.hello({ text: "Tester" });
|
||||
expect(out.greeting).toBe("Hello Tester");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user