Инвойсы на Drive: раскладка как в «07. Invoices» (Инвойсы / способ оплаты / Месяц ГГГГ / «$сумма Вендор.pdf»), перенос оплаченных; drive_folder
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
17
packages/accounting_automation/src/invoice-filing.test.ts
Normal file
17
packages/accounting_automation/src/invoice-filing.test.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { invoiceFileName, invoiceFolderPath, methodFolder, monthLabel } from "./invoice-filing.js";
|
||||
|
||||
describe("раскладка инвойсов на Drive (как «07. Invoices»)", () => {
|
||||
it("месяц и имя файла", () => {
|
||||
expect(monthLabel(new Date("2026-11-30T00:00:00Z"))).toBe("November 2026");
|
||||
expect(invoiceFileName(1500, "ACME Plumbing LLC", "inv.PDF")).toBe("$1,500.00 ACME Plumbing LLC.pdf");
|
||||
expect(invoiceFileName(null, "A/B", "x.pdf")).toBe("A B.pdf");
|
||||
});
|
||||
it("до оплаты - «Без оплаты», после - по счёту оплаты без номера", () => {
|
||||
const d = new Date("2026-03-05T00:00:00Z");
|
||||
expect(invoiceFolderPath(null, d)).toEqual(["Инвойсы", "Без оплаты", "March 2026"]);
|
||||
expect(invoiceFolderPath("Capital One 2381", d)).toEqual(["Инвойсы", "Capital One", "March 2026"]);
|
||||
expect(methodFolder("Bank of America (4455)")).toBe("Bank of America");
|
||||
expect(methodFolder("Amex")).toBe("Amex");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user