Commit graph

387 commits

Author SHA1 Message Date
regexowl
a9bf175403 test: Disable a test and update few others
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.
2024-07-29 19:20:14 +02:00
regexowl
802525edbc test: Move compliance On Recreate test to On Edit
This migrates a test from previously used On Recreate to current On Edit.
2024-07-29 13:24:30 +02:00
Ondrej Ezr
dbfa934b38 Firstboot: validate shebang is defined 2024-07-26 11:57:24 +02:00
regexowl
cba54c54c6 test: Add retry to the flakiest tests
This adds three possible retries to three of the flakiest tests.
2024-07-25 19:22:05 +02:00
Michal Gold
2c61a70fb4 buildImagesButton: change the name of build selected button <HMS-4066>
this commit  change the name of build selected button to build images
2024-07-25 15:49:23 +02:00
regexowl
c3da0af22c test: Remove deprecated flags from mocking
`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.
2024-07-25 14:45:35 +02:00
regexowl
16422e96ce test: Improve stability of 'check error details' test
This adds awaiting to a few expects, hopefully improving the stability of the test.
2024-07-23 16:23:04 +02:00
regexowl
eb2cfe9a2f test: Move @testing-library/jest-dom import to test setup file
This removes `@testing-library/jest-dom` from single test files and adds it to the shared setup.ts file.
2024-07-22 15:49:18 +02:00
Ondrej Ezr
df993c7fc2 test: Add nodeFetch back 2024-07-18 17:26:38 +02:00
Ondrej Ezr
69b7c574ae test: await click instead of element not in doc 2024-07-18 17:26:38 +02:00
Ondrej Ezr
a1a49806e1 rtk: Add base to url and fix mock handler 2024-07-18 17:26:38 +02:00
regexowl
797ceddcd1 test: Update handlers in test files
This updates handlers used directly in the test files to match current API.
2024-07-18 17:26:38 +02:00
regexowl
501323b476 MSW: Bump msw from 1.2.3 to 2.3.1
This bumps Mock Service Worker and updates the handlers.
2024-07-18 17:26:38 +02:00
regexowl
e2397b90d4 test: Fix act warnings
This removes the `act()` warnings from the test output.
2024-07-17 12:25:33 +02:00
regexowl
4fb37c187e src: Rename "V2" folders to just Wizard
This replaces all occurences of "CreateImageWizardV2" with just "CreateImageWizard" as it is the only version now.
2024-07-17 11:17:06 +02:00
regexowl
4389318de8 test: Update EditImageWizard test file for vitest
This adds mocks and imports needed to make the newly added EditImageWizard test file pass with vitest.
2024-07-16 16:55:31 +02:00
regexowl
a5f69a2559 test: Move shared imports to setup.ts file 2024-07-16 16:55:31 +02:00
regexowl
144832f2f8 test: Temporarily disable three 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
2024-07-16 16:55:31 +02:00
regexowl
98c17e55df test: Move beforeEach blocks inside describe
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.
2024-07-16 16:55:31 +02:00
regexowl
e036f9b892 src: Move .scrollTo mock implementation to setup.ts
This moves the `.scrollTo` mock implementation to a setup file for other test files to use.
2024-07-16 16:55:31 +02:00
regexowl
8597929ff3 test: test: Remove act() warnings
This removes `Warning: An update to <component> inside a test was not wrapped inact(...)` warnings.
2024-07-16 16:55:31 +02:00
regexowl
2a48966bba test: Update test files to work with Vitest
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
2024-07-16 16:55:31 +02:00
regexowl
32ec1a6d27 jest: Increase test timeout
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.
2024-07-16 10:47:54 +02:00
regexowl
989671ba95 test: Update tests
A custom repo needs to be selected for the correct mocked response.
2024-07-14 22:13:46 +02:00
Ondrej Ezr
4044b9eba1 Wizard: enable nav items properly in Edit mode 2024-07-11 09:37:36 +02:00
Jakub Rusz
9f3cb26e0a Wizard/Review: Rename from Image to blueprint
Where applicable renamed Image details or name to blueprint details or name.
2024-06-28 16:06:06 +02:00
Ondrej Ezr
facb71ceae Wizard: validate uniqueness of Blueprint name 2024-06-26 15:41:48 +02:00
regexowl
73848c9ed0 Wizard: Add Lightspeed to package recommendations
This adds "Powered by RHEL Lightspeed" text and popover to the recommended packages expandable.
2024-06-25 11:15:07 +02:00
Michal Gold
7138552663 add unit test that check disabling build image button when uncheck all targets 2024-06-25 10:21:03 +02:00
regexowl
916596d5cb test: Cleanup TargetEnvironment tests
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.
2024-06-21 16:49:24 +02:00
Ondrej Ezr
4692eae454 Wizard: validate wizard with Redux Hook
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.
2024-06-21 14:40:41 +02:00
Sanne Raymaekers
737074eb49 CreateImageWizardV2: test included packages in group popover 2024-06-21 10:12:39 +02:00
Sanne Raymaekers
d0f52bb1d6 CreateImageWizardV2: fix pagination when search is empty 2024-06-21 10:12:39 +02:00
Sanne Raymaekers
e37782ebf6 CreateImageWizardV2: add tests for package groups 2024-06-21 10:12:39 +02:00
regexowl
da1d76ad94 test: Add edit mode tests
This adds basic edit mode tests for the remaining steps.
2024-06-20 00:05:41 +02:00
Ondrej Ezr
5fcc80d2db Wizard: Drop the WizardV1 2024-06-19 09:10:22 +02:00
Amir
54d09d636e feat(HMS-4200): remove blueprint endpoints /experimental 2024-06-18 17:29:50 +02:00
regexowl
3b699f99ce test: Update tests to reflect name changes
The target acronyms on the Review step were replaced by full names of the targets. This reflects the change in the unit tests.
2024-06-18 09:19:45 +02:00
regexowl
a2ad644fb9 test: Edit mode tests for repositories
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.
2024-06-12 16:05:30 +02:00
regexowl
3d9e26469e test: Add test for CentOS 8 Stream alert
This adds a new test for CentOS 8 Stream alert and updates the fixtures accordingly.
2024-06-12 15:28:59 +02:00
Ondřej Budai
642cb10036 drop centos stream 8
CentOS Stream 8 is EOL, thus we should no longer offer it in the
service, because it can pose a security risk.

See https://blog.centos.org/2023/04/end-dates-are-coming-for-centos-stream-8-and-centos-linux-7/
2024-06-12 10:07:33 +02:00
regexowl
a23cc9321b test: Update tests after adding SaveAndBuild modal
This updates tests with a `openAndDismissSaveAndBuildModal` function that handles closing the SaveAndBuild modal after clicking on Create blueprint for the first time.
2024-06-06 16:58:59 +02:00
regexowl
45a42ce549 src: Migrate remaining files to TypeScript
This migrates remaining JavaScript files to TypeScript and updates imports.
2024-06-06 08:38:41 +02:00
regexowl
67138ad99a V2Wizard: Add tests for WSL/OpenSCAP behaviour
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
2024-06-05 17:04:14 +02:00
Andrew Dewar
5dc4ecb63f HMS-4024: Update repositories step 2024-06-04 14:05:44 +02:00
Amir
913a7d6406 WizardV2: fix google account typo 2024-05-27 09:42:13 +02:00
regexowl
12fc6b9841 V2Wizard: Set pkg recommendations expandable to open by default
This makes the pkg recommendations expandable open by default and updates the tests accordingly.
2024-05-22 16:48:11 +02:00
Sanne Raymaekers
0e74de53fa test: only test against content sources 2024-05-22 10:11:51 +02:00
Michal Gold
8092717197 WizardV2: add 'some' word to image table toolbar title 2024-05-21 14:55:20 +02:00
Sanne Raymaekers
967b603e50 src/constants: Use major rhel distros by default
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.
2024-05-21 11:24:49 +02:00