test: harden business boundary conditions
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user