From 3f1f9eeb7899eea4bd8c40cdeb64e9b5b8686c49 Mon Sep 17 00:00:00 2001 From: Catalin Oancea Date: Thu, 31 Oct 2024 23:07:28 +0200 Subject: [PATCH] Fix after rebase --- api/test/integration/map/map.spec.ts | 29 ------------------- .../project-map/project-map.spec.ts | 2 +- shared/dtos/projects/projects-map.dto.ts | 3 +- shared/lib/db-helpers.ts | 2 +- 4 files changed, 4 insertions(+), 32 deletions(-) delete mode 100644 api/test/integration/map/map.spec.ts diff --git a/api/test/integration/map/map.spec.ts b/api/test/integration/map/map.spec.ts deleted file mode 100644 index 0f047330..00000000 --- a/api/test/integration/map/map.spec.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { TestManager } from '../../utils/test-manager'; -import { HttpStatus } from '@nestjs/common'; - -describe('Map', () => { - let testManager: TestManager; - - beforeAll(async () => { - testManager = await TestManager.createTestManager(); - }); - - afterEach(async () => { - await testManager.clearDatabase(); - }); - - afterAll(async () => { - await testManager.close(); - }); - - test('should return a geojson given a countryCode', async () => { - await testManager.ingestCountries(); - const response = await testManager - .request() - .get('/map/geo-features') - .query({ countryCode: 'AND' }); - - expect(response.status).toBe(HttpStatus.OK); - expect(response.body.features.length).toBe(1); - }); -}); diff --git a/api/test/integration/project-map/project-map.spec.ts b/api/test/integration/project-map/project-map.spec.ts index 7eacbf4a..710c39b5 100644 --- a/api/test/integration/project-map/project-map.spec.ts +++ b/api/test/integration/project-map/project-map.spec.ts @@ -3,7 +3,7 @@ import { HttpStatus } from '@nestjs/common'; import { Project } from '@shared/entities/projects.entity'; import { Country } from '@shared/entities/country.entity'; import { projectsContract } from '@shared/contracts/projects.contract'; -import { ECOSYSTEM } from '@shared/entities/base-data.entity'; +import { ECOSYSTEM } from '@shared/entities/ecosystem.enum'; describe('Project Map', () => { let testManager: TestManager; diff --git a/shared/dtos/projects/projects-map.dto.ts b/shared/dtos/projects/projects-map.dto.ts index 4aba437d..bf83e828 100644 --- a/shared/dtos/projects/projects-map.dto.ts +++ b/shared/dtos/projects/projects-map.dto.ts @@ -1,11 +1,12 @@ import { z } from "zod"; import { FeatureCollection, Geometry } from "geojson"; import { ProjectGeoPropertiesSchema } from "@shared/schemas/geometries/projects"; -import { ACTIVITY, ECOSYSTEM } from "@shared/entities/base-data.entity"; import { PROJECT_PRICE_TYPE, PROJECT_SIZE_FILTER, } from "@shared/entities/projects.entity"; +import { ACTIVITY } from "@shared/entities/activity.enum"; +import { ECOSYSTEM } from "@shared/entities/ecosystem.enum"; export type ProjectGeoProperties = z.infer; diff --git a/shared/lib/db-helpers.ts b/shared/lib/db-helpers.ts index 993edff5..1efb49c2 100644 --- a/shared/lib/db-helpers.ts +++ b/shared/lib/db-helpers.ts @@ -56,7 +56,7 @@ export async function clearTestDataFromDatabase( export async function clearTablesByEntities( dataSource: DataSource, - entities: EntityTarget[], + entities: EntityTarget[] ): Promise { for (const entity of entities) { const repo = dataSource.getRepository(entity);