Skip to content

Commit e7efb5c

Browse files
committed
test: stringToDate에 잘못된 날짜 형식 입력 시 에러 발생 테스트 추가
- YYYY.MM.DD HH:mm 형식이 아닌 입력값에 대해 예외가 발생하는지 검증
1 parent f49d960 commit e7efb5c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

frontend/src/utils/stringToDate.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,11 @@ describe('stringToDate 함수 테스트', () => {
4040
'유효하지 않은 날짜 형식입니다. 형식은 "YYYY.MM.DD HH:mm" 이어야 합니다.',
4141
);
4242
});
43+
44+
it('YYYY.MM.DD HH:mm 형식이 아닌 입력에 대해 에러를 던진다', () => {
45+
const input = '1.1.1 1:1';
46+
expect(() => stringToDate(input)).toThrow(
47+
'유효하지 않은 날짜 형식입니다. 형식은 "YYYY.MM.DD HH:mm" 이어야 합니다.',
48+
);
49+
});
4350
});

0 commit comments

Comments
 (0)