fix: decouple channel test sms records
This commit is contained in:
@@ -556,7 +556,24 @@ describe('SendChainService', () => {
|
||||
|
||||
it('updates admin channel test message status without business retry routing', async () => {
|
||||
const { service, prisma, billing } = createService();
|
||||
prisma.smsBatchTask.findUnique.mockResolvedValue({ id: 'task-1', tenantId: 'tenant-1', sourceType: 'admin_channel_test' });
|
||||
prisma.smsMessageRecord.findFirst.mockResolvedValueOnce({
|
||||
id: 'record-1',
|
||||
tenantId: null,
|
||||
batchTaskId: null,
|
||||
applicationId: null,
|
||||
templateId: null,
|
||||
messageId: 'MSG-1',
|
||||
phoneNumber: '13800000001',
|
||||
content: 'hello',
|
||||
billingUnits: 1,
|
||||
unitPrice: 0,
|
||||
amountCents: 0,
|
||||
status: 'submit_queued',
|
||||
queuePriority: 'normal',
|
||||
submitId: 'SUB-1',
|
||||
gatewayMessageId: null,
|
||||
channelId: 'channel-1',
|
||||
});
|
||||
|
||||
await service.handleSubmitResult({
|
||||
messageId: 'MSG-1',
|
||||
@@ -572,6 +589,7 @@ describe('SendChainService', () => {
|
||||
|
||||
expect(prisma.channelRouteRule.findFirst).not.toHaveBeenCalled();
|
||||
expect(billing.release).not.toHaveBeenCalled();
|
||||
expect(prisma.smsBatchTask.update).not.toHaveBeenCalled();
|
||||
expect(prisma.smsMessageRecord.update).toHaveBeenCalledWith({
|
||||
where: { id: 'record-1' },
|
||||
data: expect.objectContaining({
|
||||
|
||||
Reference in New Issue
Block a user