fix: align reporting filters and carrier quality
This commit is contained in:
@@ -570,6 +570,24 @@ describe('OperationsService', () => {
|
||||
averageArrivalMs: 1800,
|
||||
},
|
||||
]);
|
||||
prisma.$queryRaw.mockResolvedValueOnce([
|
||||
{
|
||||
signatureId: 'signature-1',
|
||||
carrier: 'mobile',
|
||||
businessMessageCount: 3,
|
||||
finalSuccessCount: 2,
|
||||
finalSuccessRate: 66.7,
|
||||
averageArrivalMs: 1100,
|
||||
},
|
||||
{
|
||||
signatureId: 'signature-1',
|
||||
carrier: 'telecom',
|
||||
businessMessageCount: 2,
|
||||
finalSuccessCount: 1,
|
||||
finalSuccessRate: 50,
|
||||
averageArrivalMs: 1800,
|
||||
},
|
||||
]);
|
||||
const service = new OperationsService(prisma as never);
|
||||
|
||||
await expect(service.signatureQuality({
|
||||
@@ -584,6 +602,20 @@ describe('OperationsService', () => {
|
||||
signatureName: '【测试签名】',
|
||||
total: 5,
|
||||
channelSubmitTotal: 6,
|
||||
carrierOverview: [
|
||||
expect.objectContaining({
|
||||
carrier: 'mobile',
|
||||
businessMessageCount: 3,
|
||||
finalSuccessCount: 2,
|
||||
finalSuccessRate: 66.7,
|
||||
}),
|
||||
expect.objectContaining({
|
||||
carrier: 'telecom',
|
||||
businessMessageCount: 2,
|
||||
finalSuccessCount: 1,
|
||||
finalSuccessRate: 50,
|
||||
}),
|
||||
],
|
||||
breakdowns: [
|
||||
expect.objectContaining({ channelId: 'channel-1', carrier: 'mobile', total: 4 }),
|
||||
expect.objectContaining({ channelId: 'channel-2', carrier: 'telecom', total: 2 }),
|
||||
@@ -593,7 +625,7 @@ describe('OperationsService', () => {
|
||||
page: 2,
|
||||
pageSize: 5,
|
||||
});
|
||||
expect(prisma.$queryRaw).toHaveBeenCalledTimes(2);
|
||||
expect(prisma.$queryRaw).toHaveBeenCalledTimes(3);
|
||||
});
|
||||
|
||||
it('does not query channel details when the selected date has no registered signatures', async () => {
|
||||
|
||||
Reference in New Issue
Block a user