Adds tests that ensure the blueprint request is generated correctly for
all releases (rhel 8 & 9, centos 8 & 9) and for both architectures
(x86_64 and aarch64).
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.
Adding an optional search parameter to the V2 wizard like so:
/insights/image-builder/imagewizard?release=rhel8
results in the wizard being opened and RHEL 8 being pre-selected as the release.
The Insights assistant chat bot will make use of this feature.
The render() test utility function had to be updated to accept an
optional searchParams argument.
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
Previously the V2 Wizard's request mapper was only adding the
custom_repositories field. We also need to add a nearly duplicate
payload_repositories field due to how the image-builder API works...
which is admittedly not intuitive.
Tests are also added to ensure that requests are generated correctly
when using the custom repositories feature.
Adds tests to verify requets for images with names and descriptions are
formulated correctly.
Test functions shared/common to multiple steps were extracted to the
test utilities.
The logic for spying on an API request has been extracted into a new
reusable helper function to make writing tests that need to perform
request assertions easier.
We need to start using `undefined` as the default state for when a value
has not been defined. Previously we had used things like `’’` for string
typed values. But this causes problems later when generating the request
we send to image-builder. Using `undefined` is explicit and will make
generating the requests much easier (as we don’t need to check for `’’`,
determine the intent, and convert it to undefined if necessary).
Explicit is better than implicit.
With that in mind, tests have been added to ensure that the correct
request is sent to the API for every option on the Registration step.
This is facilitated using a new `spyOnRequest()` function. In the
future, we will have similar tests for the rest of the steps.
A few other minor things:
1. We need to get the `store` using `useStore()`
for when we later call `store.getState()` because the tests use a different
store that is configured in the renderer than the one we were importing.
2. In the wizardSlice, a new type RegistrationType is added that provides
additional type safety instead of using `string`.
this commit adds kernel arguments and enabled/disabled services to Oscap step.
and also add to Review step, add some tests to kernel and services as well.
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.
This adds the OpenSCAP step to the V2Wizard,
adds new values to the wizardSlice and enables relevant tests in the `CreateImageWizard.test.tsx` test suite
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.