feat: add PWA manifest and service worker routes with coverage

This commit is contained in:
Codex
2026-02-18 12:39:10 +00:00
parent 78d72cc4a9
commit 6ff259c0d0
4 changed files with 55 additions and 0 deletions

View File

@@ -44,6 +44,21 @@ test("rejects invalid X webhook signature", () => {
assert.equal(response.status, 401);
});
test("serves pwa manifest route", () => {
const app = createApp();
const response = app.handleRequest({
method: "GET",
path: "/manifest.webmanifest",
headers: {},
rawBody: "",
});
assert.equal(response.status, 200);
assert.match(response.headers["content-type"], /application\/manifest\+json/);
const body = JSON.parse(response.body);
assert.equal(body.short_name, "XArtAudio");
});
test("X webhook returns not_article response and no charge", () => {
const app = createApp();
postJSON(app, "/api/webhooks/polar", { userId: "u1", credits: 5, eventId: "evt1" }, "polar-secret");

View File

@@ -8,6 +8,7 @@ test("layout includes daisyui stylesheet and mobile-first wrapper", () => {
const html = layout({ title: "t", content: "x" });
assert.match(html, /daisyui@5/);
assert.match(html, /max-w-md mx-auto p-4/);
assert.match(html, /manifest.webmanifest/);
});
test("home page renders jobs list and wallet credits", () => {