Skip to content

Commit

Permalink
test: PlaceRepository findByGooglePlaceId() 메소드를 구글 플레이스 ID로 장소를 조회 #50
Browse files Browse the repository at this point in the history
  • Loading branch information
koomchang committed Nov 6, 2024
1 parent c15ea41 commit 6b61de9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions backend/src/place/place.repository.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,14 @@ describe('PlaceRepository', () => {
take: 10,
});
});

it(`장소를 Google Place ID 로 조회할 수 있다.`, async () => {
jest.spyOn(placeRepository, 'findOne').mockResolvedValue(mockPlaces[0]);
expect(await placeRepository.findByGooglePlaceId('GooglePlaceId1')).toBe(
mockPlaces[0],
);
expect(placeRepository.findOne).toHaveBeenCalledWith({
where: { googlePlaceId: 'GooglePlaceId1' },
});
});
});

0 comments on commit 6b61de9

Please sign in to comment.