Skip to content

Commit 1d0d8dc

Browse files
committed
✅ test: 누락된 테스트 rss 거절 dto 테스트 작성
1 parent 02b547a commit 1d0d8dc

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import { validate, IsNotEmpty } from 'class-validator';
2+
import { RejectRssRequestDto } from '../../../src/rss/dto/request/rejectRss';
3+
4+
describe('RejectRssRequestDto Test', () => {
5+
let dto: RejectRssRequestDto;
6+
7+
beforeEach(() => {
8+
dto = new RejectRssRequestDto({
9+
description: 'test',
10+
});
11+
});
12+
13+
describe('description', () => {
14+
it('거절 사유가 비어있다.', async () => {
15+
// given
16+
dto.description = null;
17+
18+
// when
19+
const errors = await validate(dto);
20+
21+
// then
22+
expect(errors[0].constraints).toHaveProperty('isNotEmpty');
23+
});
24+
25+
it('거절 사유가 문자열이 아니다.', async () => {
26+
// given
27+
dto.description = 1 as any;
28+
29+
// when
30+
const errors = await validate(dto);
31+
32+
// then
33+
expect(errors[0].constraints).toHaveProperty('isString');
34+
});
35+
});
36+
});

0 commit comments

Comments
 (0)