fix: close sms scheduling and billing gaps
This commit is contained in:
@@ -25,6 +25,9 @@ function createPrismaMock() {
|
||||
accountTransaction: {
|
||||
aggregate: jest.fn().mockResolvedValue({ _count: { _all: 2 }, _sum: { amountCents: -20, smsUnits: -2 } }),
|
||||
},
|
||||
cmppConnectionState: {
|
||||
groupBy: jest.fn().mockResolvedValue([{ status: 'online', _count: { _all: 1 }, _sum: { currentConnections: 2, desiredConnections: 2 } }]),
|
||||
},
|
||||
operationLog: {
|
||||
findMany: jest.fn(),
|
||||
groupBy: jest.fn(),
|
||||
@@ -66,7 +69,11 @@ describe('OperationsService', () => {
|
||||
const service = new OperationsService(prisma as never);
|
||||
|
||||
await expect(service.dashboard({ tenantId: 'tenant-1' })).resolves.toEqual(
|
||||
expect.objectContaining({ taskCount: 3, uplinkCount: 1 }),
|
||||
expect.objectContaining({
|
||||
taskCount: 3,
|
||||
uplinkCount: 1,
|
||||
gatewayConnections: [{ status: 'online', _count: { _all: 1 }, _sum: { currentConnections: 2, desiredConnections: 2 } }],
|
||||
}),
|
||||
);
|
||||
await service.statistics({ tenantId: 'tenant-1', groupBy: 'application' });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user