Skip to content

Commit

Permalink
update paths of cost surface-related endpoints in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hotzevzl committed Oct 9, 2023
1 parent 5fef549 commit 1730a2e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
12 changes: 6 additions & 6 deletions api/apps/api/test/project/project-cost-surface.fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -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({
Expand All @@ -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 });
},
Expand All @@ -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}`);
},

Expand All @@ -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();
Expand Down

0 comments on commit 1730a2e

Please sign in to comment.