15 lines
766 B
TypeScript
15 lines
766 B
TypeScript
import { summarizeReportStatuses } from './report-status';
|
|
|
|
describe('summarizeReportStatuses', () => {
|
|
it.each([
|
|
[[], { status: 'not_applicable', approved: 0, total: 0 }],
|
|
[['approved', 'approved'], { status: 'approved', approved: 2, total: 2 }],
|
|
[['failed', 'rejected'], { status: 'failed', approved: 0, total: 2 }],
|
|
[['approved', 'failed'], { status: 'partial_success', approved: 1, total: 2 }],
|
|
[['failed', 'pending'], { status: 'reporting', approved: 0, total: 2 }],
|
|
[['waiting_material', 'pending'], { status: 'waiting_material', approved: 0, total: 2 }],
|
|
])('summarizes %j without allowing one failure to override other targets', (statuses, expected) => {
|
|
expect(summarizeReportStatuses(statuses)).toEqual(expected);
|
|
});
|
|
});
|