feat: add payment report notes
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { describe, expect, it } from 'bun:test';
|
||||
import { REPORTED_PAYMENT_NOTE_MAX } from '@gruperly/shared';
|
||||
import { detectReceiptType, RECEIPT_MAX_BYTES } from '@/lib/file-type';
|
||||
import type { FileStorage } from '@/lib/storage';
|
||||
import { occurrencesBetween, startOfWeekInTimeZone } from '@/modules/home/lib/scheduler';
|
||||
@@ -45,6 +46,15 @@ describe('tipo real del comprobante (magic bytes)', () => {
|
||||
const noStorage = new ReportStudentPayment({ db: db as never, storage: null });
|
||||
const unavailable = await noStorage.execute('acc', { attendeeId: 'a1', paymentIds: ['p1'], file: { name: 'a.pdf', bytes: pad(ascii('%PDF-1.7')) } });
|
||||
expect(!unavailable.ok && unavailable.error.status).toBe(503);
|
||||
|
||||
const longNote = await useCase.execute('acc', {
|
||||
attendeeId: 'a1',
|
||||
paymentIds: ['p1'],
|
||||
note: 'x'.repeat(REPORTED_PAYMENT_NOTE_MAX + 1),
|
||||
file: { name: 'a.pdf', bytes: pad(ascii('%PDF-1.7')) },
|
||||
});
|
||||
expect(!longNote.ok && longNote.error.errors).toEqual({ note: ['too_long'] });
|
||||
expect(puts).toEqual([]);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user