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 cc88b64
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();
await expect(elements).toHaveLength(0);

Check warning on line 26 in e2e/log.spec.ts

View workflow job for this annotation

GitHub Actions / lint

Unnecessary await expression. This method does not return a Promise
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 cc88b64

Please sign in to comment.