Files
nsrbandCursor 46a2e2a7b0 feat: add gmail-hook monorepo with watcher, api, and web
Ship the receipt pipeline (Livin/Grab/BRI), PocketBase spendings, PM2 ecosystem, and a proper .gitignore that excludes secrets, SQLite data, and media dumps.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 22:58:47 +07:00

24 lines
726 B
JavaScript

import assert from "node:assert/strict";
import { describe, it } from "node:test";
import { formatReceiptAlert } from "../src/notify/ntfy.js";
describe("formatReceiptAlert", () => {
it("includes reason, messageId, and body", () => {
const text = formatReceiptAlert({
reason: "parse failed",
messageId: "abc#1",
kind: "grab.ereceipt.ride",
message: {
from: "Grab <no-reply@grab.com>",
subject: "Your Grab E-Receipt",
body: "Total Paid\nRp1.000",
html: "<b>x</b>",
},
});
assert.match(text, /reason: parse failed/);
assert.match(text, /messageId: abc#1/);
assert.match(text, /Total Paid/);
assert.match(text, /html \(length\)/);
});
});