Skip to content

Commit

Permalink
Prevent duplicate element errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ajuvonen committed Dec 13, 2024
1 parent e1d9cec commit 6bc593a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions e2e/log.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ test('logs veggies', async ({page}) => {
'This Week 2 Veggies',
);

const elements = await page.getByTestId('toast-message').all();
let elements = await page.getByTestId('toast-message').all();
for (const element of elements) {
await element.click();
}

await expect(page.getByTestId('toast-message')).toBeHidden();
elements = await page.getByTestId('toast-message').all();
expect(elements).toHaveLength(0);
await page.getByTestId('navbar-link-settings').click();
await page.getByTestId('navbar-link-log').click();
await expect(page.getByTestId('category-status-chart-center-label')).toHaveText(
Expand Down

0 comments on commit 6bc593a

Please sign in to comment.