Skip to content

Commit

Permalink
test: 빈 쿼리 에러를 반영한 테스트 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Miensoap committed Nov 30, 2024
1 parent d1763d5 commit 4d372cf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions backend/test/place/place.controller.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,11 @@ describe('PlaceController', () => {

describe('장소 검색', () => {
it('페이지, 사이즈를 설정하지 않았을 경우 기본값을 사용하여 장소를 반환한다', async () => {
const serviceResult = await placeService.getPlaces(undefined, 1, 5);
const serviceResult = await placeService.getPlaces('test', 1, 5);

const response = await request(app.getHttpServer())
.get('/places')
.query({ query: 'test' })
.expect(200);

expect(response.body).toEqual(serviceResult);
Expand All @@ -112,11 +113,11 @@ describe('PlaceController', () => {
await placeService.addPlace(defaultPlace1);
await placeService.addPlace(defaultPlace2);

const serviceResult = await placeService.getPlaces(undefined, 2, 1);
const serviceResult = await placeService.getPlaces('test', 2, 1);

const response = await request(app.getHttpServer())
.get('/places')
.query({ page: 2, limit: 1 })
.query({ query: 'test', page: 2, limit: 1 })
.expect(200);

expect(response.body).toEqual(serviceResult);
Expand Down

0 comments on commit 4d372cf

Please sign in to comment.