diff --git a/src/app/(app)/invoicing/page.test.tsx b/src/app/(app)/invoicing/page.test.tsx index 3f08f98..0602a50 100644 --- a/src/app/(app)/invoicing/page.test.tsx +++ b/src/app/(app)/invoicing/page.test.tsx @@ -211,6 +211,9 @@ describe("InvoicingPage", () => { stockBookingsListMock.mockReset(); stockBookingsListMock.mockResolvedValue(buildPageResult([], 1, 100)); process.env.NEXT_PUBLIC_QB_INVOICE_WEBHOOK_URL = "https://n8n.test/webhook/invoice"; + // Auto-accept the order-number sanity confirm dialog by default. + // Individual tests can override this with their own spy. + vi.spyOn(window, "confirm").mockReturnValue(true); }); afterEach(() => { diff --git a/src/app/(app)/invoicing/page.tsx b/src/app/(app)/invoicing/page.tsx index 588039a..555762f 100644 --- a/src/app/(app)/invoicing/page.tsx +++ b/src/app/(app)/invoicing/page.tsx @@ -1995,7 +1995,6 @@ export default function InvoicingPage() { // the order number for convenience, so this trim keeps the // default-no-fuss UX while letting an explicit number pass // through when the operator actually wants one. - const trimmedOverride = payload.orderNumberOverride?.trim() ?? ""; const explicitDeliveryNoteNumber = trimmedOverride && trimmedOverride !== group.orderNumber ? trimmedOverride