intake: the needs-header card names what is missing and gives the right advice for it
ci / lint-test (push) Successful in 49s
ci / lint-test (push) Successful in 49s
A Woolworths eReceipt SCREENSHOT has no date anywhere on it — store, total, items, payment, savings, not one date (2026-08-22, batch 60ed68be…) — while the app's own Share button sends the raw receipt with the date line. The card said 'share the top of the screen too', which is delivery-app advice and sends the person back for a shot that cannot exist. Now: the missing field by name, and for a dateless in-store receipt, the Share button or pantry's own upload.
This commit is contained in:
@@ -403,3 +403,17 @@ describe("the prompt carries no real merchant to echo", () => {
|
||||
expect(ORDER_ITEM_PROMPT).toMatch(/Do not construct a plausible order/);
|
||||
});
|
||||
});
|
||||
|
||||
describe("needsHeaderCard", () => {
|
||||
it("names the missing field and sends a dateless in-store screenshot to the app's Share button", async () => {
|
||||
const { needsHeaderCard } = await import("@/lib/intake-blocks");
|
||||
const dateless = needsHeaderCard(["date"], "woolworths").text;
|
||||
expect(dateless).toContain("no date");
|
||||
expect(dateless).toContain("Share button");
|
||||
expect(dateless).not.toContain("total");
|
||||
const delivery = needsHeaderCard(["total"], "uber_eats").text;
|
||||
expect(delivery).toContain("no total");
|
||||
expect(delivery).toContain("part of the screen");
|
||||
expect(needsHeaderCard().text).toContain("total or date");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user