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.
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.
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
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.
- `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
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.
- 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
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.
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.
- 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
anticipate common mistakes
eslint-plugin-testing-library: for writing tests with Testing Library
eslint-plugin-jest-dom: for writing tests with jest-dom
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.
`<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