feat!: move from react-toastify to sonner (#6682)
**BREAKING:** We now export toast from `sonner` instead of `react-toastify`. If you send out toasts from your own projects, make sure to use our `toast` export, or install `sonner`. React-toastify toasts will no longer work anymore. The Toast APIs are mostly similar, but there are some differences if you provide options to your toast CSS styles have been changed from Toastify ```css /* before */ .Toastify /* current */ .payload-toast-container .payload-toast-item .payload-toast-close-button /* individual toast items will also have these classes depending on the state */ .toast-info .toast-warning .toast-success .toast-error ``` https://github.com/payloadcms/payload/assets/70709113/da3e732e-aafc-4008-9469-b10f4eb06b35 --------- Co-authored-by: Paul Popus <paul@nouance.io>
This commit is contained in:
@@ -177,7 +177,7 @@ export async function saveDocHotkeyAndAssert(page: Page): Promise<void> {
|
||||
await page.keyboard.down('Control')
|
||||
}
|
||||
await page.keyboard.down('s')
|
||||
await expect(page.locator('.Toastify')).toContainText('successfully')
|
||||
await expect(page.locator('.payload-toast-container')).toContainText('successfully')
|
||||
}
|
||||
|
||||
export async function saveDocAndAssert(
|
||||
@@ -189,10 +189,10 @@ export async function saveDocAndAssert(
|
||||
await page.click(selector, { delay: 100 })
|
||||
|
||||
if (expectation === 'success') {
|
||||
await expect(page.locator('.Toastify')).toContainText('successfully')
|
||||
await expect(page.locator('.payload-toast-container')).toContainText('successfully')
|
||||
await expect.poll(() => page.url(), { timeout: POLL_TOPASS_TIMEOUT }).not.toContain('create')
|
||||
} else {
|
||||
await expect(page.locator('.Toastify .Toastify__toast--error')).toBeVisible()
|
||||
await expect(page.locator('.payload-toast-container .toast-error')).toBeVisible()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user