File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed
Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change 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+ } ) ;
You can’t perform that action at this time.
0 commit comments