From b7ca3f70b33d036fb8a2be5e02223067c6cc6eb0 Mon Sep 17 00:00:00 2001 From: yulia-bel Date: Mon, 25 Sep 2023 14:33:50 +0200 Subject: [PATCH] Update wdpa names in protected areas list endpoint --- .../protected-area/getter/selection-get.service.ts | 4 ++-- api/apps/api/test/scenario-protected-areas/fixtures.ts | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/api/apps/api/src/modules/scenarios/protected-area/getter/selection-get.service.ts b/api/apps/api/src/modules/scenarios/protected-area/getter/selection-get.service.ts index 8a456a4d12..34b8d66775 100644 --- a/api/apps/api/src/modules/scenarios/protected-area/getter/selection-get.service.ts +++ b/api/apps/api/src/modules/scenarios/protected-area/getter/selection-get.service.ts @@ -40,7 +40,7 @@ export class SelectionGetService { return [ ...categories.map((category) => ({ - name: category, + name: 'IUCN ' + category, id: category, kind: ProtectedAreaKind.Global, selected: @@ -69,7 +69,7 @@ export class SelectionGetService { return [ ...categories.map((category) => ({ - name: category, + name: 'IUCN '+ category, id: category, isCustom: false, })), diff --git a/api/apps/api/test/scenario-protected-areas/fixtures.ts b/api/apps/api/test/scenario-protected-areas/fixtures.ts index e7141c59d3..a5eddef4cb 100644 --- a/api/apps/api/test/scenario-protected-areas/fixtures.ts +++ b/api/apps/api/test/scenario-protected-areas/fixtures.ts @@ -132,7 +132,7 @@ export const getFixtures = async () => { { id: 'III', kind: 'global', - name: 'III', + name: 'IUCN III', selected: false, }, ]); @@ -156,7 +156,7 @@ export const getFixtures = async () => { response.data.sort(); expect(response.data).toHaveLength(1); expect(response.data[0].attributes.isCustom).toBe(false); - expect(response.data[0].attributes.name).toBe('III'); + expect(response.data[0].attributes.name).toBe('IUCN III'); expect(response.data[0].attributes.scenarioUsageCount).toBe(1); }, @@ -166,7 +166,7 @@ export const getFixtures = async () => { expect(response.data[0].attributes.isCustom).toBe(true); expect(response.data[0].attributes.name).toBe('custom protected area'); expect(response.data[1].attributes.isCustom).toBe(false); - expect(response.data[1].attributes.name).toBe('III'); + expect(response.data[1].attributes.name).toBe('IUCN III'); }, GivenCustomProtectedAreaWasAddedToProject: async () => { @@ -302,7 +302,7 @@ export const getFixtures = async () => { expect(response.find((e) => e.id === category)).toEqual({ id: category, kind: `global`, - name: category, + name: 'IUCN ' + category, selected: true, }); }, @@ -313,7 +313,7 @@ export const getFixtures = async () => { expect(response.find((e) => e.id === category)).toEqual({ id: category, kind: `global`, - name: category, + name: 'IUCN ' + category, selected: false, }); },