Skip to content

Commit

Permalink
fix: broken feature.e2e test + make error message clearer (#3623)
Browse files Browse the repository at this point in the history
This PR fixes a broken e2e test by relaxing what it checks for. It must
have been developed in parallel so that the test wasn't included before
merging into main.
  • Loading branch information
thomasheartman committed Apr 26, 2023
1 parent b2bb550 commit 0a613de
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lib/error/api-error.ts
Expand Up @@ -301,7 +301,7 @@ export const fromOpenApiValidationErrors = (
return new UnleashError({
name: 'ValidationError',
message:
"The request payload you provided doesn't conform to the schema. Check the `details` property for a list of errors that we found.",
"Request validation failed: the payload you provided doesn't conform to the schema. Check the `details` property for a list of errors that we found.",
// @ts-expect-error We know that the list is non-empty
details,
});
Expand Down
3 changes: 2 additions & 1 deletion src/test/e2e/api/admin/feature.e2e.test.ts
Expand Up @@ -916,6 +916,7 @@ test('Should throw error when updating a flexibleRollout strategy with "" for st
.expect((res) => {
const result = res.body;
expect(res.status).toBe(400);
expect(result.error).toBe('Request validation failed');
expect(result.message.includes('validation'));
expect(result.message.includes('failed'));
});
});

0 comments on commit 0a613de

Please sign in to comment.