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.
This commit is contained in:
Aleksandar Todorov 2020-11-24 12:43:53 +02:00 committed by Sanne Raymaekers
parent 0895a122f5
commit e106a32431

View file

@ -22,8 +22,8 @@ async function verifyCancelButton(cancel) {
// this goes back to the landing page
await waitFor(
() => [
screen.getByText('Create a new image'),
screen.getByRole('button', { name: /Create image/ }),
screen.getByTestId('create-image-action'),
screen.getByTestId('images-table'),
]
);
}
@ -352,8 +352,8 @@ describe('Click through all steps', () => {
// returns back to the landing page
// await waitFor(
// () => [
// screen.getByText('Create a new image'),
// screen.getByRole('button', { name: /Create image/ }),
// screen.getByTestId('create-image-action'),
// screen.getByTestId('images-table'),
// ]
// );
});