From 5f96ab1c279a16ed7b35a38722804de98f122796 Mon Sep 17 00:00:00 2001 From: andrea rota Date: Fri, 6 Dec 2024 13:35:31 +0000 Subject: [PATCH] update tests to match current expected values --- .../compute-area.service.spec.ts | 5 ++- .../upload-feature/upload-feature.fixtures.ts | 36 +++++++++---------- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/api/apps/api/src/modules/scenarios-features/compute-area.service.spec.ts b/api/apps/api/src/modules/scenarios-features/compute-area.service.spec.ts index b65b8cc474..5204a8c00b 100644 --- a/api/apps/api/src/modules/scenarios-features/compute-area.service.spec.ts +++ b/api/apps/api/src/modules/scenarios-features/compute-area.service.spec.ts @@ -96,7 +96,10 @@ const getFixtures = async () => { }, { provide: getRepositoryToken(GeoFeature), - useValue: { findOneOrFail: findGeoFeatureMock }, + useValue: { + findOneOrFail: findGeoFeatureMock, + findOne: findGeoFeatureMock, + }, }, { provide: GeoFeaturesService, diff --git a/api/apps/api/test/upload-feature/upload-feature.fixtures.ts b/api/apps/api/test/upload-feature/upload-feature.fixtures.ts index 43f63ab401..8dbc2ab594 100644 --- a/api/apps/api/test/upload-feature/upload-feature.fixtures.ts +++ b/api/apps/api/test/upload-feature/upload-feature.fixtures.ts @@ -389,25 +389,23 @@ export const getFixtures = async () => { featureClassName: name, }, }); - expect(features).toEqual([ - { - id: expect.any(String), - featureClassName: name, - featureDataStableIds: null, - description, - alias: null, - amountMax: 5296399725.20094, - amountMin: 820348505.9774874, - propertyName: null, - intersection: null, - creationStatus: JobStatus.created, - projectId, - isCustom: true, - isLegacy: false, - fromGeoprocessingOps: null, - geoprocessingOpsHash: null, - }, - ]); + const expectedFeature = new GeoFeature(); + expectedFeature.id = expect.any(String); + expectedFeature.featureClassName = name; + expectedFeature.featureDataStableIds = [expect.any(String)]; + expectedFeature.description = description; + expectedFeature.alias = null; + expectedFeature.amountMax = 5296399725.20094; + expectedFeature.amountMin = 820348505.9774874; + expectedFeature.propertyName = undefined; + expectedFeature.intersection = undefined; + expectedFeature.creationStatus = JobStatus.created; + expectedFeature.projectId = projectId; + expectedFeature.isCustom = true; + expectedFeature.isLegacy = false; + expectedFeature.fromGeoprocessingOps = undefined; + expectedFeature.geoprocessingOpsHash = undefined; + expect(features).toEqual([expectedFeature]); expect( await geoFeatureDataRepo.find({ where: {