From 1730a2e6e6993f7173b9a205ff81803f1e3f1513 Mon Sep 17 00:00:00 2001 From: andrea rota Date: Mon, 9 Oct 2023 10:12:24 +0100 Subject: [PATCH] update paths of cost surface-related endpoints in tests --- .../project-template.controller.integration.spec.ts | 4 ++-- .../test/project/project-cost-surface.fixtures.ts | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/api/apps/api/src/modules/projects/shapefile-template/project-template.controller.integration.spec.ts b/api/apps/api/src/modules/projects/shapefile-template/project-template.controller.integration.spec.ts index 8c29a08f97..44b1673097 100644 --- a/api/apps/api/src/modules/projects/shapefile-template/project-template.controller.integration.spec.ts +++ b/api/apps/api/src/modules/projects/shapefile-template/project-template.controller.integration.spec.ts @@ -21,7 +21,7 @@ test(`cost surface template - should return a file when it is calculated`, async fixtures.templateAvailable('123', 'sample shapefile'); // when const test = request(app.getHttpServer()).get( - '/api/v1/projects/123/cost-surface/shapefile-template', + '/api/v1/projects/123/cost-surfaces/shapefile-template', ); // then const response = await test.expect(200); @@ -47,7 +47,7 @@ it(`should return a timeout when file is in progress`, async () => { fixtures.templateInProgress(`123`); // when const test = request(app.getHttpServer()).get( - '/api/v1/projects/123/cost-surface/shapefile-template', + '/api/v1/projects/123/cost-surfaces/shapefile-template', ); // then await test.expect(504); diff --git a/api/apps/api/test/project/project-cost-surface.fixtures.ts b/api/apps/api/test/project/project-cost-surface.fixtures.ts index 74e908e3ca..bfc74d6174 100644 --- a/api/apps/api/test/project/project-cost-surface.fixtures.ts +++ b/api/apps/api/test/project/project-cost-surface.fixtures.ts @@ -166,12 +166,12 @@ export const getProjectCostSurfaceFixtures = async () => { WhenGettingCostSurfacesForProject: async (projectId: string) => { return request(app.getHttpServer()) - .get(`/api/v1/projects/${projectId}/cost-surface`) + .get(`/api/v1/projects/${projectId}/cost-surfaces`) .set('Authorization', `Bearer ${token}`); }, WhenGettingCostSurfaceForProject: async (projectId: string, id: string) => { return request(app.getHttpServer()) - .get(`/api/v1/projects/${projectId}/cost-surface/${id}`) + .get(`/api/v1/projects/${projectId}/cost-surfaces/${id}`) .set('Authorization', `Bearer ${token}`); }, WhenUploadingCostSurfaceShapefileForProject: async ( @@ -180,7 +180,7 @@ export const getProjectCostSurfaceFixtures = async () => { shapefilePath: string, ) => { return request(app.getHttpServer()) - .post(`/api/v1/projects/${projectId}/cost-surface/shapefile`) + .post(`/api/v1/projects/${projectId}/cost-surfaces/shapefile`) .set('Authorization', `Bearer ${token}`) .attach(`file`, shapefilePath) .field({ @@ -193,7 +193,7 @@ export const getProjectCostSurfaceFixtures = async () => { costSurfaceName: string, ) => { return request(app.getHttpServer()) - .patch(`/api/v1/projects/${projectId}/cost-surface/${costSurfaceId}`) + .patch(`/api/v1/projects/${projectId}/cost-surfaces/${costSurfaceId}`) .set('Authorization', `Bearer ${token}`) .send({ name: costSurfaceName }); }, @@ -202,7 +202,7 @@ export const getProjectCostSurfaceFixtures = async () => { costSurfaceId: string, ) => { return request(app.getHttpServer()) - .delete(`/api/v1/projects/${projectId}/cost-surface/${costSurfaceId}`) + .delete(`/api/v1/projects/${projectId}/cost-surfaces/${costSurfaceId}`) .set('Authorization', `Bearer ${token}`); }, @@ -212,7 +212,7 @@ export const getProjectCostSurfaceFixtures = async () => { ) => { return request(app.getHttpServer()) .get( - `/api/v1/projects/${projectId}/cost-surface/${costSurfaceId}/cost-range`, + `/api/v1/projects/${projectId}/cost-surfaces/${costSurfaceId}/cost-range`, ) .set('Authorization', `Bearer ${token}`) .send();