Commit graph

3559 commits

Author SHA1 Message Date
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
Sanne Raymaekers
ec298c769f npm: Use npm-update to keep all packages updated
Rather than freezing the packages and updating them manually, use
npm-update to have the latest available version.
2020-11-02 19:40:48 +01:00
Ryan Long
e71004f291
update keys for deployments (#28) 2020-10-30 10:39:57 -05:00
Major Hayden
c9d5751d57
🚀 Deploy to stage-beta and stage-stable (#25)
Ensure we deploy to stage-beta (when master is updated) and stage-stable (when master-stable is updated).
2020-10-30 07:26:38 -05:00
Sanne Raymaekers
1829bd82d2 tools: Make make-bots executable 2020-10-27 18:09:24 +01:00
Sanne Raymaekers
04846a3fa5 github: Move action to workflows folder 2020-10-27 17:36:36 +01:00
Sanne Raymaekers
7c4efebff8 github: Add npm-update action 2020-10-27 17:24:07 +01:00
Jacob Kozol
ea09205a27 test: add initial jest tests
Basic jest tests are added for the landing page. These tests use the
react testing library so the enzyme dependencies are removed from the
package.json. The travis config is also updated.
2020-10-22 10:23:08 +02:00
Jacob Kozol
1d46f5a618 src: move main component to App component
The Main component in the LandingPage component has been moved to the
App component. This is required so the tests can mock the store without
any insights information.
2020-10-22 10:23:08 +02:00
Major Hayden
404a80e59c 📦 Denote AWS image as raw
We had issues in composer a while back with VHDX in AWS and we have been
using raw images since then.

Signed-off-by: Major Hayden <major@redhat.com>
2020-09-22 15:55:08 +02:00
Sanne Raymaekers
16ec5a7e3f
On travis run with NODE_ENV=production (#11)
* package.json: Clean up scripts

* travis: Run travis build scripts

These run with NODE_ENV=production, which is needed to have correct
routing on all clouddot instances.
2020-09-22 08:23:26 -05:00
Major Hayden
4c6c3fae1b 📦 package.json: Update scripts section
The starter app has been updated over the last few months and new
options are required in the `scripts` section of `package.json`.

Bring the `scripts` section in line with the starter app to fix some
issues around routing requests to `/beta` in CI.

Signed-off-by: Major Hayden <major@redhat.com>
2020-09-22 10:30:34 +02:00
Sanne Raymaekers
a8cd717f55
src: Change page title to Image Builder (#8) 2020-09-21 16:03:19 -05:00