feat: polish reporting templates and shared controls
This commit is contained in:
@@ -78,4 +78,18 @@ describe('ReportsService', () => {
|
||||
orderBy: [{ sentUnits: 'desc' }, { reportDate: 'desc' }, { dimensionName: 'asc' }],
|
||||
}));
|
||||
});
|
||||
|
||||
it('exports complete filtered report data as escaped CSV instead of the current page', async () => {
|
||||
prisma.dailyReconciliationReport.findMany.mockResolvedValueOnce([{
|
||||
id: 'recon-export', reportDate: new Date('2026-07-14'), tenantName: '示例,企业', applicationName: '应用A',
|
||||
sentUnits: 12, successUnits: 10, generatedAt: new Date('2026-07-15T00:00:00Z'),
|
||||
}]);
|
||||
const exported = await service.exportReconciliation({ tenantId: 'tenant-1', dateFrom: '2026-07-01', dateTo: '2026-07-14' });
|
||||
expect(exported.fileName).toContain('对账单-');
|
||||
expect(exported.content).toContain('"示例,企业"');
|
||||
expect(prisma.dailyReconciliationReport.findMany).toHaveBeenCalledWith(expect.objectContaining({
|
||||
where: expect.objectContaining({ tenantId: 'tenant-1' }),
|
||||
orderBy: [{ reportDate: 'desc' }, { tenantName: 'asc' }, { applicationName: 'asc' }],
|
||||
}));
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user