serokell / coffer

Multi-backend password store with multiple frontends
4 stars 2 forks source link

Setup integration tests for the Web API #104

Closed dcastro closed 2 years ago

dcastro commented 2 years ago

Clarification and motivation

We have a few tests for the Web API written in mocha.

The main reason why they were written in javascript in the first place was so that they would serve as documentation for whoever writes the frontend. However:

  1. This makes maintaining them (a bit) harder.
  2. Enabling the tests in the pipeline will also be a bit more troublesome.
  3. The frontend will (probably) be written in Purescript, so it's not like having the api's tests in javascript helps that much.

I think we could still achieve our goal (documenting the web API) if we re-write the tests in Haskell, without using a servant client and without relying on coffer's data types/encoders/decoders. We could just write json literals in the tests (e.g. with aesonQQ), manually add the headers, etc.

These tests should:

Let's:

We'll write the remaining tests in a separate issue

Acceptance criteria