debian-image-builder-frontend/src/test/Components/CreateImageWizardV2
lucasgarfield 8c31e6f54f V2Wizard/Registration: Add request assertion tests
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`.
2024-02-14 17:01:52 +01:00
..
steps V2Wizard/Registration: Add request assertion tests 2024-02-14 17:01:52 +01:00
CreateImageWizard.compliance.test.tsx v2Wizrd: add kernel and services data 2024-02-12 17:12:26 +01:00
CreateImageWizard.content.test.tsx test: Enable tests 2024-01-26 14:04:56 +01:00
CreateImageWizard.test.tsx Blueprints: Add handler for creating new blueprint 2024-02-12 15:12:14 +01:00
wizardTestUtils.tsx V2Wizard/Registration: Add request assertion tests 2024-02-14 17:01:52 +01:00