forked from wangziqi/gongxue-base
23 lines
678 B
TypeScript
23 lines
678 B
TypeScript
import { SyncController } from './sync.controller';
|
|
|
|
describe('SyncController — schedule sync options', () => {
|
|
it('forwards the attendance-machine-only option', async () => {
|
|
const syncService = {
|
|
syncScheduleToDingTalk: jest.fn().mockResolvedValue({ syncedItems: 0 }),
|
|
};
|
|
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');
|
|
|
|
expect(syncService.syncScheduleToDingTalk).toHaveBeenCalledWith(
|
|
'2026-07-10',
|
|
30,
|
|
true,
|
|
);
|
|
});
|
|
});
|