mirror of
https://github.com/Sea-Haven-Industries/seahaven-ap.git
synced 2026-10-02 14:23:24 +00:00
* feat(shared): add payment ladder and CSV domain package Introduce @seahaven-ap/shared via npm workspaces so FE and future API share payments-dashboard-compatible status ladders, pay-date helpers, and CSV headers. * fix(web): build shared package before vite dev Ensure fresh npm ci && npm run dev (and Playwright webServer) can resolve @seahaven-ap/shared dist exports that are gitignored.
18 lines
725 B
TypeScript
18 lines
725 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { isReadyToPay, statusAfterPayRun, statusAfterPaymentCleared } from "./invoice-status.js";
|
|
|
|
describe("invoice status helpers", () => {
|
|
it("treats approved as Ready-to-Pay", () => {
|
|
expect(isReadyToPay("approved")).toBe(true);
|
|
expect(isReadyToPay("pending_approval")).toBe(false);
|
|
expect(isReadyToPay("scheduled")).toBe(false);
|
|
expect(isReadyToPay("paid")).toBe(false);
|
|
expect(isReadyToPay("rejected")).toBe(false);
|
|
expect(isReadyToPay("void")).toBe(false);
|
|
});
|
|
|
|
it("exposes post pay-run and cleared invoice statuses", () => {
|
|
expect(statusAfterPayRun()).toBe("scheduled");
|
|
expect(statusAfterPaymentCleared()).toBe("paid");
|
|
});
|
|
});
|