Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(server/graphql): assert error code and fix some tests #2758

Merged
merged 3 commits into from
Aug 27, 2024

Conversation

iainsproat
Copy link
Contributor

@iainsproat iainsproat commented Aug 26, 2024

Description & motivation

In tests the code of error needs to be asserted, not just the presence of an error. It was possible for tests to pass but due to an unexpected error code. This PR introduces assertions on error codes to prevent this type of regression.

Changes:

  • assertions on the error code in graphql tests
  • when deleting a Speckle app, if the app cannot be found we return a Forbidden Error.
  • A user input error is returned in the case where a token cannot be removed. Either the token does not exist or the user does not own it.
  • some tests polluted the test environment through re-use of the same email address for the test user. A random email address is used to prevent test pollution.
  • fixes invalid graphql in a test

To-do before merge:

Screenshots:

Validation of changes:

Checklist:

  • My pull request follows the guidelines in the Contributing guide?
  • My pull request does not duplicate any other open Pull Requests for the same update/change?
  • My commits are related to the pull request and do not amend unrelated code or documentation.
  • My code follows a similar style to existing code.
  • I have added appropriate tests.
  • I have updated or added relevant documentation.

References

@iainsproat iainsproat marked this pull request as ready for review August 26, 2024 16:10
@iainsproat iainsproat merged commit afbdead into main Aug 27, 2024
22 of 24 checks passed
@iainsproat iainsproat deleted the iain/fix-graphql-error-logging branch August 27, 2024 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants