fix: Toast Onclose is removing specific toast (#9960)

* toast behaviour fixed

* Update showToast.tsx

* Adjust E2E test for toast

---------

Co-authored-by: Peer Richelsen <[email protected]>
This commit is contained in:
Anik Dhabal BabuandPeer Richelsen authored and GitHub committed 2023-07-25 22:27:14 +00:00
1 parent 06dcaaef3b
commit 50d2dad62c
4 files changed
+28 -27

No files matched your search

+1 -1
View File
@@ -23,7 +23,7 @@ test.describe("Change Password Test", () => {
await page.locator("text=Update").click();
const toast = await page.waitForSelector("div[class*='data-testid-toast-success']");
const toast = await page.waitForSelector('[data-testid="toast-success"]');
expect(toast).toBeTruthy();
});
+2 -2
View File
@@ -15,7 +15,7 @@ test.describe("Change Theme Test", () => {
//Click the update button
await page.click('[data-testid="update-theme-btn"]');
//Wait for the toast to appear
const toast = await page.waitForSelector("div[class*='data-testid-toast-success']");
const toast = await page.waitForSelector('[data-testid="toast-success"]');
expect(toast).toBeTruthy();
//Go to the profile page and check if the theme is dark
await page.goto(`/${pro.username}`);
@@ -35,7 +35,7 @@ test.describe("Change Theme Test", () => {
//Click the update theme button
await page.click('[data-testid="update-theme-btn"]');
//Wait for the toast to appear
const toast = await page.waitForSelector("div[class*='data-testid-toast-success']");
const toast = await page.waitForSelector('[data-testid="toast-success"]');
expect(toast).toBeTruthy();
//Go to the profile page and check if the theme is light
await page.goto(`/${pro.username}`);
+1 -1
View File
@@ -97,7 +97,7 @@ test.describe("Event Types tests", () => {
return !!url.pathname.match(/\/event-types\/.+/);
});
await page.locator("[data-testid=update-eventtype]").click();
const toast = await page.waitForSelector("div[class*='data-testid-toast-success']");
const toast = await page.waitForSelector('[data-testid="toast-success"]');
expect(toast).toBeTruthy();
});