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