-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feat/chart' of https://github.com/boostcampwm-2024/web0…
…5-Denamu into feat/chart
- Loading branch information
Showing
8 changed files
with
109 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
name: Test | ||
name: BE Test | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- 'server/**' | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { validate } from 'class-validator'; | ||
import { StatisticQueryDto } from '../../../src/statistic/dto/statistic-query.dto'; | ||
|
||
describe('StatisticQueryDto', () => { | ||
it('실수를 입력한다.', async () => { | ||
// given | ||
const dto = new StatisticQueryDto(); | ||
dto.limit = 1.1; | ||
|
||
// when | ||
const errors = await validate(dto); | ||
|
||
// then | ||
expect(errors.length).toBe(1); | ||
expect(errors[0].constraints).toHaveProperty( | ||
'isInt', | ||
'정수로 입력해주세요.', | ||
); | ||
}); | ||
it('문자열을 입력한다.', async () => { | ||
// given | ||
const dto = new StatisticQueryDto(); | ||
dto.limit = 'test' as unknown as number; | ||
|
||
// when | ||
const errors = await validate(dto); | ||
|
||
// then | ||
expect(errors.length).toBe(1); | ||
expect(errors[0].constraints).toHaveProperty( | ||
'isInt', | ||
'정수로 입력해주세요.', | ||
); | ||
}); | ||
it('음수를 입력한다.', async () => { | ||
// given | ||
const dto = new StatisticQueryDto(); | ||
dto.limit = -1; | ||
|
||
// when | ||
const errors = await validate(dto); | ||
|
||
// then | ||
expect(errors.length).toBe(1); | ||
expect(errors[0].constraints).toHaveProperty( | ||
'min', | ||
'limit 값은 1 이상이어야 합니다.', | ||
); | ||
}); | ||
}); |
Oops, something went wrong.