Test `Repositories edit mode modal pops up when deselecting previously used repository` is temporarily disabled. Also there were some early exits, the awaiting should do the trick.
`image-builder.new-wizard.enabled`, `image-builder.wizard.oscap.enabled` and `image-builder.enable-content-sources` are no longer used in the code base and thus don't need to be mocked in tests.
This temporarily disables three tests:
- target environment tiles are keyboard selectable -> can't make the behaviour correct even in mocked browser, it's possible this test was passing dues to early exit
- image name invalid for more than 100 chars and description for 250 -> this test times out in waitFor for the typing action. We have other valid/invalid name tests which could probably replace this one to not overwhelm the test suite with awaiting a large amount of text
- validate first boot request -> `monaco-editor` mock will be probably needed to make this one pass as it's not included in jsdom and ends in `Ne. init is not a function` error
This moved the `beforeEach` blocks inside the `describe` blocks as per documentation.
Previously the code inside `beforeEach` didn't trigger which lead to problems with asynchrocinity as mocks didn't get cleared.
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.
This cleans up structure of `src/test/Components/CreateImageWizardV2/steps/TargetEnvironment`, removing the subfolders and surfacing Aws and Azure test files.
We also had two `TargetEnvironment.test.tsx` files, both testing functionality of the Image Output step. For now those were merged into one file under `ImageOutput` step and can be later renamed to `ImageOutput.test.tsx` for consistency.
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 adds a new 'repositories' fixture to the blueprints as was done for 'oscap'.
Newly added unit tests check that repositories get parsed from and back to request correctly and that when removing previously used repositories an 'Are you sure?' modal pops up.
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 new tests:
- test that alert is rendered and OpenSCAP dropdown is disabled for WSL target only
- test that alert is rendered, but OpenSCAP dropdown is still enabled for target list that includes WSL
The tradeoff is not being able to discern between a minor version and a
major version in the 2 weeks post GA if the images were built using the
UI, but I think the tradeoff is worth it. The frontend will never need
updating to switch to a new version.