Skip to content

Commit

Permalink
expectToast and expectNoToast use toContainText instead of toHaveText
Browse files Browse the repository at this point in the history
  • Loading branch information
david-crespo committed Nov 28, 2024
1 parent 148775e commit 3525cc3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/e2e/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,15 @@ export async function stopInstance(page: Page) {
* Assert that a toast with text matching `expectedText` is visible.
*/
export async function expectToast(page: Page, expectedText: string | RegExp) {
await expect(page.getByTestId('Toasts')).toHaveText(expectedText)
await expect(page.getByTestId('Toasts')).toContainText(expectedText)
await closeToast(page)
}

/**
* Assert that a toast with text matching `expectedText` is not visible.
*/
export async function expectNoToast(page: Page, expectedText: string | RegExp) {
await expect(page.getByTestId('Toasts')).not.toHaveText(expectedText)
await expect(page.getByTestId('Toasts')).not.toContainText(expectedText)
}

/**
Expand Down

0 comments on commit 3525cc3

Please sign in to comment.