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>
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
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\)/);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user