fix: refresh pending report detail summary
This commit is contained in:
@@ -1231,7 +1231,14 @@ describe('SmsConfigService', () => {
|
||||
expect(result.items[0]).not.toHaveProperty('drainageReportTargets');
|
||||
});
|
||||
|
||||
it('returns the filtered total of signature channel-carrier details still awaiting batch generation', async () => {
|
||||
it.each([
|
||||
['abandoned', 1],
|
||||
['pending', 2],
|
||||
['reporting', 2],
|
||||
['approved', 2],
|
||||
['failed', 2],
|
||||
['rejected', 2],
|
||||
])('keeps the pending detail total aligned after a persisted %s task status', async (taskStatus, expectedTotal) => {
|
||||
const prisma = createPrismaMock();
|
||||
prisma.smsSignature.findMany.mockImplementation(({ where }) => {
|
||||
if (where?.AND) {
|
||||
@@ -1242,7 +1249,7 @@ describe('SmsConfigService', () => {
|
||||
materialVersion: 2,
|
||||
application: { status: 'active' },
|
||||
reportTasks: [
|
||||
{ channelId: 'channel-1', carrier: 'mobile', status: 'abandoned', approvalScope: 'carrier_specific' },
|
||||
{ channelId: 'channel-1', carrier: 'mobile', status: taskStatus, approvalScope: 'carrier_specific' },
|
||||
],
|
||||
reportBatchItems: [],
|
||||
},
|
||||
@@ -1273,7 +1280,7 @@ describe('SmsConfigService', () => {
|
||||
|
||||
const result = await service.listSignaturesPage({ signatureKeyword: '测试', page: 1, pageSize: 10 });
|
||||
|
||||
expect(result.pendingReportDetailTotal).toBe(1);
|
||||
expect(result.pendingReportDetailTotal).toBe(expectedTotal);
|
||||
expect(prisma.smsSignature.findMany).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
where: { AND: [expect.objectContaining({ name: { contains: '测试' } }), { auditStatus: 'approved', pendingReport: true }] },
|
||||
|
||||
Reference in New Issue
Block a user