fix permissions and teacher attendance workflows
This commit is contained in:
22
apps/server/src/sync/sync.controller.spec.ts
Normal file
22
apps/server/src/sync/sync.controller.spec.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
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,
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user