Skip to content

Commit

Permalink
update tests to match updated implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
hotzevzl committed Aug 4, 2023
1 parent 56043c0 commit 0c505a4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions api/apps/api/test/upload-feature/upload-feature.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ test(`if tagging info is included in DTO and valid, created feature should be ta
);

// ASSERT
await fixtures.ThenGeoFeaturesAreCreated(result, name, description);
await fixtures.ThenGeoFeaturesAreCreated(result, name, description, tag);
await fixtures.ThenGeoFeatureTagIsCreated(name, tag);
});

Expand All @@ -86,7 +86,7 @@ test(`if there is already an existing feature with a tag that has equivalent cap
);

// ASSERT
await fixtures.ThenGeoFeaturesAreCreated(result, name, description);
await fixtures.ThenGeoFeaturesAreCreated(result, name, description, equivalentTag);
await fixtures.ThenGeoFeatureTagIsCreated(name, equivalentTag);
// TODO Check for update of last_modified_at for all affected tag rows for project when implemented
});
10 changes: 7 additions & 3 deletions api/apps/api/test/upload-feature/upload-feature.fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,14 @@ export const getFixtures = async () => {
result: request.Response,
name: string,
description: string,
tag?: string,
) => {
expect(result.body).toEqual({
success: true,
});
// Check response payload, in JSON:API format
expect(result.body?.data?.type).toEqual('geo_features');
expect(result.body?.attributes?.isCustom).toEqual(true);
expect(result.body?.attributes?.featureClassName).toEqual(name);
expect(result.body?.attributes?.tag).toEqual(tag);

const features = await geoFeaturesApiRepo.find({
where: {
projectId,
Expand Down

0 comments on commit 0c505a4

Please sign in to comment.