feat: add Jinshuju student sync

This commit is contained in:
2026-07-22 11:37:20 +08:00
parent 1dc13274de
commit 393ee62168
18 changed files with 1378 additions and 12 deletions

View File

@@ -43,4 +43,23 @@ describe('SyncController — schedule sync options', () => {
expect(syncService.triggerSync).toHaveBeenCalledWith('dingtalk_students', 12);
});
it('returns Jinshuju form fields for the selector', async () => {
const syncService = {
getJinshujuFormFields: jest.fn().mockResolvedValue({
name: '报名表',
fields: [{ key: 'field_1', label: '姓名', type: 'single_line_text' }],
}),
};
const controller = new SyncController(syncService as never);
const result = await controller.getJinshujuFields({
apiKey: 'key',
apiSecret: 'secret',
formToken: 'form-a',
});
expect(syncService.getJinshujuFormFields).toHaveBeenCalledWith('key', 'secret', 'form-a');
expect(result.data.fields[0]).toMatchObject({ key: 'field_1', label: '姓名' });
});
});