forked from wangziqi/gongxue-base
27 lines
709 B
TypeScript
27 lines
709 B
TypeScript
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,
|
|
});
|
|
});
|
|
});
|