debian-image-builder-frontend/src/test
lucasgarfield c4b59374f2 Redux: Add clones slice
This commit updates the Redux store so that the new clone API end points
can be used. The composes slice is updated - composes now have a clones
property - and a clones slice is added.

Selectors are added as well. Although not used in this commit, the
selectors will allow us to significantly simplify our React components
that need to retreive data from the store.

We now must work with both `composes` and `clones`. `Composes` and `clones`
have slightly different schema in the Redux store because of differences
in their API responses (the store schema generally mirrors the API
response schema). Selectors are defined for `images` that work for
both `composes` and `clones`.

Using selectors allows our React components to interact with the Redux store
as if it were a database - components can simply query the store by id
using a selector. This hugely simplifies our React components - they no
longer need to accept multiple props related to a `compose` (or `clone`
or `image`). They can simply take a `composeId` (or `cloneId` or
`imageId`) prop and use an appropriate selector to obtain the necessary
information.

Selectors also encapsulate the store schema. Components no longer need to know
about the store schema to get information about an image - they simply
use a selector and in return receive a normalized (and flat) object.
This means that in the future we could easily migrate the API and slices
to RTK Query without the need to modify any of our React components.
2022-11-08 11:29:31 +01:00
..
Components Redux: Add clones slice 2022-11-08 11:29:31 +01:00
redux Redux: Modernize Redux store 2022-09-30 13:17:09 +02:00
.eslintrc test: Add two more eslint plugin to follow best practices and 2020-11-06 10:03:26 +01:00
README.md Add README with info around testing 2020-11-03 15:31:40 +01:00
testUtils.js ESLint: Use --fix with new rules to order import declarations 2022-09-14 13:24:38 +02:00

Testing information

Code coverage

Code coverage is recorded in codecov.io. This information comes only from unit tests and for the time being we're not concerned with collecting coverage information from integration tests.

It must be over 85% as required by Insights QE!