feat: add PWA manifest and service worker routes with coverage
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user