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.
This updates the logic of parsing bytesize into size/unit pair.
Currently 'GiB' is set as a default which causes problem with smaller partitions on Edit.
A validation for the min_size is in place and the rule is that the size cannot be smaller than 0 of a given unit. If there was a partition with smaller size in KiB it will break the rule when converted to GiB.
Edit mode is now fully tested and working for OpenSCAP profiles. A
handler for the PUT request was added and the fixtures were updated to
support this.
`EditImageWizard.tsx`: Previously we dispatched `initializeWizard()`
while waiting for the blueprintDetails to load. This meant that the
state was incorrect (empty) while the blueprintDetails request was
in flight.
`requestMapper.tsx`: Correctly populate state in edit mode if the
blueprint contains a custom file system – previously custom mountpoints
were dropped and automatic mode was selected.
`spyOnRequest()`: Differentiate between request types (e.g. GET, PUT)
for the same endpoint.
This replaces 'image-installer' target with 'guest-image' in happy path tests which allows proper testing of FSC functionality. File system customisations are not applied to bare metal - installer images.
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.
The snapshot_date in the image_request must be a date. snapshot_date is
an optional field and if no snapshot is used, the field should be
undefined. Previously it was an empty string and this caused image
builder to return a code 400 with message "Snapshot date is not in
DateOnly (yyyy-mm-dd) format".