Commit graph

28 commits

Author SHA1 Message Date
Sanne Raymaekers
1b9cf6df7b src: Remove SmartComponents/PresentationalComponents split
Just have a directory per component.
2021-04-22 10:23:51 +02:00
Sanne Raymaekers
28cc248335 CreateImageWizard: Move steps into separate components 2021-04-14 17:34:30 +02:00
Jacob Kozol
f00cf08506 CreateImageWizard: add registration validation
If register now is selected, an activation key is required. If no
activation key is entered the Next and Create buttons are disabled.
Also, if the activation key is empty an error message will appear to
prompt the user to enter an activation key.

The subscription errors variable is removed in favor of declaring the
error message directly in the registration step component. The
validateSubscription function is removed in favor of validating the
activation key field on change.
2021-03-23 18:34:27 +01:00
Jacob Kozol
f268441d41 CreateImageWizard: validate upload destination
The user should not be able to continue without selecting an upload
destination. The uploadDestination fields are now checked to see if one
is selected before enabling the Next button in the footer. Also, the
onSaveInProgress variable is changed to isSaveInProgress to conform with
the other validation variables.
2021-03-15 14:37:27 +01:00
Sanne Raymaekers
398eeb8cb2 CreateImageWizard: Add Azure upload step 2021-03-08 10:03:04 +00:00
Jacob Kozol
22385fd5ea CreateImageWizard: add google upload step
The user can now specify their authentication settings for Google Cloud
Platform. These can be either a Google account, Service account, Google
group, or a domain.
2021-03-05 16:21:08 +01:00
Sanne Raymaekers
6adab8bd3b CreateImageWizard: Fix review step
The wizard crashed in the review step when registering the system later
was selected.
2021-03-03 12:36:53 +01:00
Jacob Kozol
43e87a184d CreateImageWizard: update review page
The review page now uses more patternfly components and has been split
up a little so it is easier to add review fields for additional target
environments.
2021-03-01 17:01:58 +01:00
Jacob Kozol
6b575c5478 CreateImageWizard: add package step
The additional package selection step is added to the create image
wizard. Users can now query for packages and select them from a list.
These packages are not yet passed into the blueprint customizations and
are just for display. Tests have been updated and added.
2021-02-24 18:50:02 +00:00
Jacob Kozol
5e81d5daf9 CreateImageWizard: support multiple upload providers
The user can now select between multiple upload providers. AWS, Azure,
and Google. The selection uses tiles and the user can select one or more
destinations. Currently, only aws supports setting the upload
parameters.

The icons point to files hosted on cloud.redhat.com.
2021-02-19 12:10:57 +01:00
Jacob Kozol
b17d9b5325 CreateImageWizard: display in modal
The wizard now displays inside a modal.
2021-02-04 17:19:02 +01:00
Sanne Raymaekers
5adb8b581e CreateImageWizard: Only ask for aws account id in upload step 2020-12-18 11:46:01 +01:00
Jenn Giardino
142674b43b components: Moves wizard steps into separate files
Replaces the flex layout in Review step with more semantic `<dl>`
elements.

Be more compliant with designs.
2020-12-10 14:45:32 +01:00
Aleksandar Todorov
31eef3b83e tests: implement commented out assertion for the Create button
see previous commit for explanation why we do it like that!

Also simplify how the mocked backend API returns a promise and
wait for it on the assertions.
2020-11-30 13:32:40 +02:00
Aleksandar Todorov
7639452298 tests: Spy on history.push instead of trying to assert page change
When the SUT calls history.push that will cause a page redirect
inside the browser. However it doesn't cause the new page to be
rendered when running the test suite hence all assertions fail!

The reason for this is that Jest + RTL use jsdom under the hood,
which partially implements HTML/DOM APIs but **IS NOT** a browser!

It also turns out RTL is not well suited for end-to-end scenarios
which cover multiple pages.

This commit:

- patches renderWithReduxRouter() to also return the history object
  so we can set a spy on it later
- changes eslint confirugration to ignore unused variables starting
  with underscore
- updates the verifyCancelButton() function and scenarios which
  make use of it
2020-11-30 13:32:40 +02:00
Aleksandar Todorov
8fcc10006b Change verifyCancelButton to return a promise and wait on it
instead of waiting inside verifyCancelButton() make it return the
result of waitFor, which is a promise, and wait on it inside each
individual test scenario.
2020-11-30 13:32:40 +02:00
Aleksandar Todorov
49044c5746 tests: Redo waiting for elements to be removed to resolve warning
gets rid of:

Warning: You seem to have overlapping act() calls, this is not
supported. Be sure to await previous act() calls before making a
new one.
2020-11-25 12:07:36 +01:00
Aleksandar Todorov
e106a32431 Use getByTestId() instead of getByText
for asserting if user is on landing page b/c the text
"Create a new image" is present on both the landing page and the
wizard.
2020-11-24 14:55:40 +01:00
Aleksandar Todorov
0895a122f5 test: Cover the Create button with all valid values 2020-11-24 14:55:40 +01:00
Aleksandar Todorov
530988f1da Test CreateImageWizard with missing values 2020-11-24 14:55:40 +01:00
Sanne Raymaekers
33e9db6681 tests: More updates
- `npm run test:single` runs jest with `-w 1`, makes the output readable
- adds testIds to the radio buttons, I think it's a bit bugged where if
  you click the label it'll automatically switch to the first radio button
  (even if you click the label of the 2nd button)
- moved a misplaced wait
2020-11-18 16:38:23 +02:00
Aleksandar Todorov
da5df65394 Update verifyCancelButton
b/c when rendering the CreateImageWizard the container doesn't
include the main app headline
2020-11-18 16:38:23 +02:00
Aleksandar Todorov
bf7d551865 tests: mock the insights dependency to avoid failures 2020-11-18 16:38:23 +02:00
Aleksandar Todorov
48fcbda28d tests: simplify calls to waitForElementToBeRemoved and reorder
otherwise we get:

Error: The element(s) given to waitForElementToBeRemoved are
already removed. waitForElementToBeRemoved requires that the
element(s) exist(s) before waiting for removal.
2020-11-18 16:38:23 +02:00
Aleksandar Todorov
44fecec797 Add tests switching between fields in AmazonUploadComponent 2020-11-18 16:38:23 +02:00
Aleksandar Todorov
f01568c263 Add more test automation. Refs #40
- Make activation key input field required

- Registration step in CreateImageWizard
  - should allow choosing activation keys
  - should hide input fields when clicking Register the system later
2020-11-12 10:59:47 +01:00
Aleksandar Todorov
afe02e0f2e Add more tests for Create Image Wizard
- sanity validation of each of the 4 steps
- click through buttons Next/Back/Cancel

Notes:

- add data-testid attribute for the release select field b/c
there's no better way to query it
- add @testing-library/jest-dom for additional asserts
2020-11-09 10:52:33 +01:00
Aleksandar Todorov
a5e56eea2f Initial test for CreateImageWizard
very basic, make sure we can render all of the expected text
2020-11-03 16:48:46 +01:00