Commit graph

2971 commits

Author SHA1 Message Date
Jacob Kozol
d66ef828f8 CreateImageWizard: remove isInPage
The isInPage wizard property was causing console errors in both the
browser and the tests.
2021-02-04 17:19:02 +01:00
Sanne Raymaekers
1883a065f7 Same folder name between presentational and smart components 2021-02-03 12:58:49 +01:00
Sanne Raymaekers
e814ae1bb8 workflows: Move npm-update to Ubuntu 20.04
See https://github.com/cockpit-project/starter-kit/pull/409
2021-01-26 10:09:24 +01:00
Sanne Raymaekers
9bfa5f8c1f CreateImageWizard: Make sure to check the right error 2021-01-26 10:09:11 +01:00
Sanne Raymaekers
f4c6fe908a README.md: Fix dated information
The process got a bit more complex with the mandatory client ssl
auth for composer.
2021-01-15 17:40:57 +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
9c1125cf37
LandingPage: Adds empty state when no images 2020-12-17 17:43:43 +01:00
Jenn Giardino
4cbd745ec5 Removes stack layout from wizard 2020-12-17 11:36:29 +01:00
Sanne Raymaekers
eca63afeed src: Replace Main with React.Fragment in App.js
We shouldn't apply any style at this point, and let any style be
determined by the page we're embedded in.
2020-12-16 17:24:39 +01:00
Sanne Raymaekers
788291e329 package.json: Update frontend-components-config
The later versions also recognize `main` as a beta branch.
2020-12-16 14:12:28 +01:00
Jenn Giardino
5463af8cd6 Adds a Stack layout to have the wizard footer visible
TLDR; before this update the user always has to scroll to get to
the footer actions in the wizard.

There's a weird nested page section thing happening which results
in the wizard body+footer being 100% of the height of the main content
area, but when you add the wizard header as a separate section above
the 100% height wizard body+footer, the header pushes the wizard
contents down so that the bottom portion of the wizard (equal to the
height of the header, and roughly the height of the footer) is always out
of view. This means that the user always has to scroll to get to the
footer.
2020-12-16 11:39:29 +01:00
Jenn Giardino
b40f623f65 Includes additional PF toolbar components to complete the toolbar layout
I'm not certain that TableToolbar is the right component to use vs the PF Toolbar
but am leaving it for the moment.
2020-12-16 11:36:20 +01:00
Jenn Giardino
c6153c26b1 Updates target column to display the full cloud provider name 2020-12-16 11:36:20 +01:00
Jenn Giardino
38b277737e Updates release column in table to display a blue label 2020-12-16 11:36:20 +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
Sanne Raymaekers
3763457b8e package.json: Update major versions of react and patternfly 2020-11-27 11:35:23 +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
7c6ebd9d6f Pass props.upload.options instead of null
this fixes CI failure exposed in the previous commit
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
Sanne Raymaekers
ea459a7cb8 Rename master to main 2020-11-18 14:47:33 +01: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
Sanne Raymaekers
68954d854b test: Expand ImageTable test 2020-11-12 10:58:57 +01:00
Jenn Giardino
c73df5b1d8 Adds icons and text strings for image build status 2020-11-12 10:58:57 +01:00
Sanne Raymaekers
7f6f828b56 Revert "Update travis config file to rebase on master before test running"
This reverts commit bd99a90faa.

While this is common in cockpit's projects, osbuild projects refrain
from rebasing branches.

Rebasing on master as it happens to be when the test is running, leaves
you in a state where you neither know that the branch itself is working,
nor that it will work when you actually do merge it later, because
master might have changed in between.
2020-11-11 13:04:23 +02:00
Xiaofeng Wang
bd99a90faa Update travis config file to rebase on master before test running 2020-11-11 10:22:51 +01:00
Sanne Raymaekers
abb3bbc868 test: Make sure the status of a compose is called status
This was a bit confusing because in the inline documentation, I wrote
that a compose used state as a key. However this changed to status
pretty early on and I forgot to update it.

Also use an actual uuid with proper length.
2020-11-10 12:34:30 +02:00
Sanne Raymaekers
a39304a3ba eslint: jsx-tag-spacing and jsx-closing-bracket-location rules 2020-11-09 18:25:51 +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
7c78b5b029 tests: Add test coverage for composeReducer() function. Refs #40 2020-11-09 10:52:33 +01:00
Xiaofeng Wang
d4cb1c4d6b test: Add two more eslint plugin to follow best practices and
anticipate common mistakes

eslint-plugin-testing-library: for writing tests with Testing Library
eslint-plugin-jest-dom: for writing tests with jest-dom
2020-11-06 10:03:26 +01:00
Cockpit Project
afdfb6f387 package.json: Update @patternfly/react-core package dependency
Closes #39
2020-11-05 10:40:26 +01:00
Alexander Todorov
56d3701962
Improve test coverage
tests: Add test for updateCompose redux action
2020-11-05 10:40:04 +01:00
Jenn Giardino
a77b248526 Rearranged landing page to have a table and action
As mentioned in the previous commit, `<Main>` doesn't really
belong in App.js, it instead belongs in LandingPage.js, because
it creates the html/css wrapper for the main contents, as a
sibling to the `<PageHeader>` component used in LandingPage.js.
However, including `<Main>` in LandingPage.js will cause the
tests to fail. Therefore, just the html and classes that
`<Main>` creates is used in LandingPage.js.
2020-11-04 12:24:17 +01:00
Jenn Giardino
00d81f0444 Fix styles for <Main> in App.js
`<Main>` doesn't really belong in App.js given the html it renders,
but there's some additional thing happening with this component
that requires it to be here to support tests. This update addresses
the extra padding that it creates by being used at this level.

Closes #17
2020-11-04 12:24:17 +01:00
Aleksandar Todorov
dbc702575a Make base-url https and add missing // 2020-11-03 16:49:12 +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
Cockpit Project
a407bc9490 package.json: Update @redhat-cloud-services/frontend-components-utilities package dependency
Closes #35
2020-11-03 15:31:56 +01:00
Aleksandar Todorov
d0cb431b69 Add README with info around testing 2020-11-03 15:31:40 +01:00
Cockpit Project
983801a637 package.json: Update @redhat-cloud-services/frontend-components package dependency
Closes #32
2020-11-02 20:11:28 +01:00
Sanne Raymaekers
a7749e01dc api: Use plural URL forms
Be compliant with api design guidelines, see osbuild/image-builder#42.
2020-11-02 19:41:42 +01:00