This updates the files to be compatible with Vitest. Changes include:
- adding `@testing-library/jest-dom` import to enable custom jest matchers
- renaming `jest.` to `vi.`
- setting flags to false as default where needed
This increases default test timeout from 10000 to 20000 and timeout for "image name invalid for more than 100 chars and description for 250" to 50000.
This should eliminate test flakes caused by timing out, later it will be "reverted" when the Vitest migration gets merged.
Use redux hook to validate the form.
This gives us single point of contact for "is the data valid?"
while not requiring every redux action touching form data to perform validation.
It's not perfect and might be improved when using external library solving the problems we're having.
This updates tests with a `openAndDismissSaveAndBuildModal` function that handles closing the SaveAndBuild modal after clicking on Create blueprint for the first time.
This adds two tests that check whether the "Manually configure partitions" options is hidden on ISO only target and shown when combined with another target.
This renames actions on the primary button on Review step for the Create mode so it's clear whether you're creating a blueprint from a scratch or saving changes to an already existing blueprint.
The FSC step is added to the wizard and takes full advantage of Redux
for state management.
This is still a work in progress.
Supported features:
1. Select partition mountpoint prefix (e.g. /var, /home)
2. Edit partition mountpoint suffix (e.g. /home/videogames)
3. Change displayed units (KiB, MiB, GiB)
Supported but buggy features:
1. Edit partition size
Unsupported features:
1. Add partitions
2. Remove partitions
3. Validation
The previous commit adjusts the necessary feature flags to expose the
new blueprints table and V2 wizard in stage-preview.
This causes tests where isBeta() == false to fail. This commit changes
the relevant useChrome() mocks such that isBeta() returns true.
This fixes a bug on the registration step which made the text "Connect to Red Hat Insights" not to get rendered when registering with rhc.
All registration tests were also enabled in CreateImageWizard.test.tsx
This created a new folder for the Review step and copies components that will be needed:
- ReviewStep.tsx
- ReviewStepTables.tsx
- ReviewStepTextLists.tsx
This removes a leftover debugging statement and changes `getBy` query to an awaited async `findBy` as this was causing problems in the test when the checked component wasn't immediately available.
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.
The tests have not been modified at this point, only uncommented, so the
next commit will have a clear diff.
Some data-testids were added to radio selectors and the Google principle
input as well for use in the tests.
The tests have been converted from .js to .tsx and all lines have been
commented out. As steps are added to the wizard, the relevant lines will
be uncommented. The V2 wizard can be considered finish when all
commented lines have been removed. Proceeding this way (as opposed to
starting with an empty test file and adding tests back) will help us
ensure we do not accidently 'drop' a test.
Add integration and unit tests for the wizard. The integration testing
is making sure that the wizard holds up together, is navigable and has
at least a happy path tested.
The unit test of the ImageOuput tests more combinations of clicks on the
interface and make sure the inner logic is sound.
The intersection of the two tests brings us confidence that the UX will
work according to spec.