86dff75898
Closes the test gaps from the PR #622 work + the export-scope feature: - export scope: scopeLedger/normalizeScope (exported via _internal) unit tests + renderTaxReportCsv income/cost/all output assertions (income drops supplier rows, cost drops invoice rows, filename gets the scope tag). - isUniqueViolation: Postgres 23505 / SQLITE_CONSTRAINT / "UNIQUE constraint failed" message, false for FK + nullish (the IMAP claim-first race detector). - getRenderedPagePath: out-of-range pages reject with PAGE_OUT_OF_RANGE before touching pdftoppm/disk (the per-file resource bound).
11 lines
534 B
JavaScript
11 lines
534 B
JavaScript
const rasterizeService = require('../../src/services/rasterizeService');
|
|
|
|
// The page-range guard runs BEFORE any fs/pdftoppm work, so these reject
|
|
// without touching the binary or disk (PR #622 concern 6).
|
|
describe('getRenderedPagePath page-range guard', () => {
|
|
it.each([0, -1, 201, 1000, 1.5, NaN])('rejects out-of-range page %p', async (page) => {
|
|
await expect(rasterizeService.getRenderedPagePath(1, '/tmp/does-not-exist.pdf', page))
|
|
.rejects.toMatchObject({ statusCode: 400, code: 'PAGE_OUT_OF_RANGE' });
|
|
});
|
|
});
|