Skip to content

An opinionated toast component for React.

fix typo in tests (#106)

Emil Kowalski686a2b406eb7
diff --git a/test/tests/basic.spec.ts b/test/tests/basic.spec.ts
index 2ac3825..357cfb3 100644
--- a/test/tests/basic.spec.ts
+++ b/test/tests/basic.spec.ts
@@ -104,6 +104,7 @@ test.describe('Basic functionality', () => {
await expect(page.locator('[data-sonner-toaster]')).toHaveAttribute('data-theme', 'light');
await page.getByTestId('theme-button').click();
await expect(page.locator('[data-sonner-toaster]')).toHaveAttribute('data-theme', 'dark');
+ });
test('return focus to the previous focused element', async ({ page }) => {
await page.getByTestId('custom').focus();
@@ -112,5 +113,6 @@ test.describe('Basic functionality', () => {
await page.getByTestId('dismiss-button').focus();
await page.keyboard.press('Enter');
await expect(page.locator('[data-sonner-toast]')).toHaveCount(0);
+ await expect(page.getByTestId('custom')).toBeFocused();
});
});