test: harden business boundary conditions

This commit is contained in:
2026-07-15 00:03:55 +08:00
parent 17a5046ea0
commit b1f35f9d1a
65 changed files with 2311 additions and 293 deletions

View File

@@ -1,4 +1,5 @@
import { SyncController } from './sync.controller';
import { ScheduleSyncQueryDto } from './dto/schedule-sync.dto';
describe('SyncController — schedule sync options', () => {
it('forwards the attendance-machine-only option', async () => {
@@ -7,11 +8,11 @@ describe('SyncController — schedule sync options', () => {
};
const controller = new SyncController(syncService as never);
await (controller.syncSchedule as unknown as (
dateFrom?: string,
days?: string,
attendanceMachineOnly?: string,
) => Promise<unknown>)('2026-07-10', '30', 'true');
await controller.syncSchedule(Object.assign(new ScheduleSyncQueryDto(), {
dateFrom: '2026-07-10',
days: 30,
attendanceMachineOnly: true,
}));
expect(syncService.syncScheduleToDingTalk).toHaveBeenCalledWith(
'2026-07-10',