forked from didi/xiaoju-survey
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdateMessagePushingTask.dto.spec.ts
40 lines (32 loc) · 1.05 KB
/
updateMessagePushingTask.dto.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { UpdateMessagePushingTaskDto } from '../dto/updateMessagePushingTask.dto';
import { MESSAGE_PUSHING_HOOK } from 'src/enums/messagePushing';
describe('UpdateMessagePushingTaskDto', () => {
let dto: UpdateMessagePushingTaskDto;
beforeEach(() => {
dto = new UpdateMessagePushingTaskDto();
});
it('should be defined', () => {
expect(dto).toBeDefined();
});
it('should have a nullable name', () => {
dto.name = null;
expect(dto.name).toBeNull();
});
it('should have a nullable type', () => {
dto.type = null;
expect(dto.type).toBeNull();
});
it('should have a nullable push address', () => {
dto.pushAddress = null;
expect(dto.pushAddress).toBeNull();
});
it('should have a triggerHook', () => {
dto.triggerHook = MESSAGE_PUSHING_HOOK.RESPONSE_INSERTED;
expect(dto.triggerHook).toBeDefined();
expect(dto.triggerHook).toEqual(MESSAGE_PUSHING_HOOK.RESPONSE_INSERTED);
});
it('should have a nullable array of surveys', () => {
dto.surveys = null;
expect(dto.surveys).toBeNull();
});
});