HackIllinois / api

The Official API supporting HackIllinois
https://api.hackillinois.org
Other
23 stars 51 forks source link

Adds E2E tests for event service #494

Closed Nydauron closed 1 year ago

Nydauron commented 2 years ago

All tests should query one endpoint. Each endpoint should have a test under normal conditions, a test with insufficient perms (if applicable), and any other tests triggering any other errors that the endpoint can generate.

These tests are coded up to expect new appropriate error codes instead of the standard always 500 on failure.

Nydauron commented 1 year ago

We might want to consider not doing deep equals with ApiErrors, since message content changing will then require updating a test, which might be more of a hassle. It doesn't hurt that much though, so it's more just food for thought.

The API errors that get returned are typically static strings, so checking these will only help reinforce that we are getting the intended error message. And yeah, while we would need to edit the expected error in the tests, it should be a quick change and rather detectable.

Timothy-Gonzalez commented 1 year ago

We might want to consider not doing deep equals with ApiErrors, since message content changing will then require updating a test, which might be more of a hassle. It doesn't hurt that much though, so it's more just food for thought.

The API errors that get returned are typically static strings, so checking these will only help reinforce that we are getting the intended error message. And yeah, while we would need to edit the expected error in the tests, it should be a quick change and rather detectable.

Alright, sounds good!