From 0ee7f5d64a4a826901c47e2144355ce12f918658 Mon Sep 17 00:00:00 2001 From: hyohyo12 <129946082+hyohyo12@users.noreply.github.com> Date: Wed, 27 Nov 2024 21:35:16 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20beforeAll=20=EB=A1=9C=20=EB=8D=B0?= =?UTF-8?q?=EC=9D=B4=ED=84=B0=EB=B2=A0=EC=9D=B4=EC=8A=A4=20=EC=B4=88?= =?UTF-8?q?=EA=B8=B0=ED=99=94/=20Color=20=EC=82=AC=EC=9A=A9=20=EB=B0=A9?= =?UTF-8?q?=EB=B2=95=20=EB=B3=80=EA=B2=BD=20#166?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../integration-test/map.integration.test.ts | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/backend/test/map/integration-test/map.integration.test.ts b/backend/test/map/integration-test/map.integration.test.ts index a15e5b6a..02eca8fb 100644 --- a/backend/test/map/integration-test/map.integration.test.ts +++ b/backend/test/map/integration-test/map.integration.test.ts @@ -69,8 +69,7 @@ describe('MapController 통합 테스트', () => { placeRepository = new PlaceRepository(dataSource); userRepository = new UserRepository(dataSource); - await userRepository.query(`ALTER TABLE USER AUTO_INCREMENT = 1`); - await userRepository.delete({}); + await initMapUserPlaceTable(mapRepository, userRepository, placeRepository); const [fakeUser1Entity, fakeUser2Entity] = await userRepository.save([ fakeUser1, @@ -241,7 +240,7 @@ describe('MapController 통합 테스트', () => { publicMapsWithPlace.forEach((publicMapWithPlace) => { publicMapWithPlace.mapPlaces = []; publicMapWithPlace.mapPlaces.push( - MapPlace.of(1, publicMapWithPlace, 'RED' as Color, 'test'), + MapPlace.of(1, publicMapWithPlace, Color.RED, 'test'), ); }); await mapRepository.save([ @@ -272,27 +271,30 @@ describe('MapController 통합 테스트', () => { }); it('GET /maps?query 에 대한 요청으로 공개 되어있고 query 와 유사한 title을 가지는 지도들을 반환한다.', async () => { - const coolMaps = createPublicMapsWithTitle( + const publicMapsWithCoolTitle = createPublicMapsWithTitle( 2, fakeUser1, 'cool test title', ); - const coolMapsWithPlace = createPublicMapsWithTitle( + const publicMapsWithCoolTitleAndPlace = createPublicMapsWithTitle( 3, fakeUser1, 'cool title', ); const privateMaps = createPrivateMaps(5, fakeUser1); - coolMapsWithPlace.forEach((publicMapWithPlace) => { + publicMapsWithCoolTitleAndPlace.forEach((publicMapWithPlace) => { publicMapWithPlace.mapPlaces = []; publicMapWithPlace.mapPlaces.push( - MapPlace.of(1, publicMapWithPlace, 'RED' as Color, 'test'), + MapPlace.of(1, publicMapWithPlace, Color.RED, 'test'), ); }); - coolMaps.forEach((publicMap) => { + publicMapsWithCoolTitle.forEach((publicMap) => { publicMap.mapPlaces = []; }); - const publicMaps = [...coolMaps, ...coolMapsWithPlace]; + const publicMaps = [ + ...publicMapsWithCoolTitle, + ...publicMapsWithCoolTitleAndPlace, + ]; await mapRepository.save([...publicMaps, ...privateMaps]); return request(app.getHttpServer())