forked from wangziqi/gongxue-base
fix(integration): simplify manual DingTalk sync setup
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import {
|
||||
buildDingTalkConfigPayload,
|
||||
isAppSecretRequired,
|
||||
} from './integration-config-form';
|
||||
|
||||
describe('DingTalk integration config form', () => {
|
||||
it('requires AppSecret only for the first configuration', () => {
|
||||
expect(isAppSecretRequired(false)).toBe(true);
|
||||
expect(isAppSecretRequired(true)).toBe(false);
|
||||
});
|
||||
|
||||
it('builds a manual-sync config without the retired startEnable flag', () => {
|
||||
expect(
|
||||
buildDingTalkConfigPayload({
|
||||
corpId: 'ding-corp',
|
||||
agentId: 'app-key',
|
||||
appSecret: '',
|
||||
}),
|
||||
).toEqual({
|
||||
corpId: 'ding-corp',
|
||||
agentId: 'app-key',
|
||||
appSecret: undefined,
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user