Commit graph

10 commits

Author SHA1 Message Date
regexowl
0982cbe8db test: Update tests
After bumping redux from 4.2.1 to 5.0.1 and @reduxjs/toolkit from 1.9.5 to 2.0.1 some tests started to fail. Added async logic solves the issue.
2024-01-19 10:23:02 +01:00
regexowl
f90718815b test: Replace .getBy queries by awaited .findBy
Components sometimes render slower than tests run which causes failures when the test suite expects elements that did not finish their rendering yet.

This should help to prevent most of possible problems with the rendering speed.
2024-01-17 17:19:57 +01:00
regexowl
62673813e2 test: Remove out-of-date comments
This cleans up comments in tests and removes all that are no longer relevant.
2023-11-27 13:52:20 +01:00
mgold1234
9ab3d45f99 Wizard: add all/selected toggle buttons to custom repository step
This commit resolves #1201.
It adds a toggle to the repositories step that allows users to toggle
between all and selected repositories.
2023-11-21 14:43:32 +01:00
regexowl
7b0b9a8ddc test: Fix await-async-events error
After cleaning up the ESLint plugins a new error for eslint-plugin-testing-library popped up. This PR solves all of the occurences of `Promise returned from async event method `user` must be handled` and removes the `"testing-library/await-async-events": "off"` switch which was temporary put in place.
2023-11-08 14:15:17 +01:00
Thomas Lavocat
826882d1ef tests: adapt to target appearing dynamically
There is now a delay between when the user clicks on the architecture
button (or just goes onto the step) and when the targets are being
displayed. This is due to the fact that the data to filter which targets
needs to be displayed has to be fetched from the backend. And during the
meantime a loading spinner is shown.

To adapt to this the code simply waits for the fields to be accessible.

Refs HMS-1135
2023-10-26 20:07:54 +02:00
lucasgarfield
7b9e726151 ImagesTable: Convert ImagesTable to Typescript & RTK Query
This commit converts the Images Table to Typescript and converts all API
calls to image-builder to use RTK Query hooks.

This should increase the performance of the app significantly.
Previously our calls to the image-builder API were made in series. They
are now made in parallel. We may want to investigate the possibility of
hitting rate limiting now that we will be issuing requests in much more
rapid succession.

In the tests, moving to RTK Query hooks has allowed us to remove
virtually all Jest mocking. However, this means that some of our
previous tests which tested against implementation details were broken.
Most notably, we no longer check the Redux store to verify that clones
have been added correctly and we no longer check that compose requests
were issued successfully. Test coverage will be restored in a follow-up
PR where the dev-dependency @msw/data is added. Adding a persistent data
layer to the tests using @msw/data will allow us to verify that our POST
requests (creating composes and cloning them) are working by testing
that the Images Table has been updated.
2023-09-18 10:35:04 +02:00
regexowl
9f5a0af826 Wizard: Update the Repositories step
This updates the Repositories and Review step as per [mocks](https://www.sketch.com/s/d7aa6d29-fca0-4283-a846-09cc5fd10612/a/MyEbDz7).

Repositories with the unavailable or invalid status have a popover that allows for further inspection. The time of the last introspection and the counter of failed attempts was added to the popover, together with the "Go to Repositories" button.

On Recreate the payload repositories are checked against "freshly" fetched list of repositories. In case any of the previously checked repositories is no longer available in content sources an Alert is rendered on both Repositories and Review steps. The unavailable repository is checked, but the checkbox is disabled and the information is dashed out. Since the information about the repository is stored in the Repository type, the only information available to be rendered is the baseurl.

Create image button is also disabled when recreating an image with unavailable repositories.
2023-09-11 10:30:04 +02:00
regexowl
e71d98da08 test: Update CreateImageWizard tests
This updates following test suites after bumping react and testing-library:
- CreateImageWizard.azure.test.js
- CreateImageWizard.azure.2.test.js
- CreateImageWizard.content.test.js
- CreateImageWizard.test.js
2023-08-30 16:01:02 +02:00
Ondrej Ezr
8b796ef431 Switch to Content Sources search
Enable searching for RH packages through Content Sources service.
Gates the search by Content Sources feature flag, to keep the easy kill switch.
2023-08-24 14:41:16 +02:00