fix payment customer and dashboard settings
Build & Deploy / Build & Push Docker Image (push) Successful in 12m39s
Test / Type Check (all packages) (push) Successful in 5m8s
Build & Deploy / Deploy to VPS (push) Successful in 7s
Test / API Unit Tests (push) Failing after 4m24s
Test / Homepage Unit Tests (push) Successful in 3m27s
Test / Storefront Unit Tests (push) Successful in 4m48s
Test / Admin Unit Tests (push) Successful in 3m0s
Test / Dashboard Unit Tests (push) Successful in 4m18s
Test / API Integration Tests (push) Failing after 4m34s
Build & Deploy / Build & Push Docker Image (push) Successful in 12m39s
Test / Type Check (all packages) (push) Successful in 5m8s
Build & Deploy / Deploy to VPS (push) Successful in 7s
Test / API Unit Tests (push) Failing after 4m24s
Test / Homepage Unit Tests (push) Successful in 3m27s
Test / Storefront Unit Tests (push) Successful in 4m48s
Test / Admin Unit Tests (push) Successful in 3m0s
Test / Dashboard Unit Tests (push) Successful in 4m18s
Test / API Integration Tests (push) Failing after 4m34s
This commit is contained in:
@@ -54,4 +54,32 @@ describe('invoicePdfService', () => {
|
||||
props: expect.objectContaining({ data: expect.objectContaining({ invoiceNumber: 'INV-2026-000001' }) }),
|
||||
}))
|
||||
})
|
||||
|
||||
it('falls back to a simple PDF when the React PDF renderer fails', async () => {
|
||||
renderToBufferMock.mockRejectedValueOnce(new Error('renderer failed'))
|
||||
|
||||
const result = await generateInvoicePdf({
|
||||
invoiceNumber: 'INV-2026-000002',
|
||||
issueDate: '2026-06-09T00:00:00.000Z',
|
||||
dueDate: null,
|
||||
company: { name: 'Atlas Cars', email: 'billing@atlas.test', address: { formatted: 'Casablanca' } },
|
||||
amount: 80000,
|
||||
currency: 'MAD',
|
||||
status: 'OPEN',
|
||||
paymentProvider: 'MANUAL',
|
||||
lineItems: [{ description: 'Migration assistance', amount: 30000, currency: 'MAD', quantity: 2, unitAmount: 15000 }],
|
||||
totals: {
|
||||
subtotalAmount: 80000,
|
||||
discountAmount: 0,
|
||||
creditAmount: 0,
|
||||
taxAmount: 0,
|
||||
totalAmount: 80000,
|
||||
amountPaid: 0,
|
||||
amountDue: 80000,
|
||||
},
|
||||
})
|
||||
|
||||
expect(result.subarray(0, 8).toString()).toBe('%PDF-1.4')
|
||||
expect(result.toString()).toContain('INV-2026-000002')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user