Refactor toast module (#26677)
1. Do not use "async" 2. Call `hideToast` instead of `removeElement` for manual closing
This commit is contained in:
parent
e4b2bdfbc0
commit
a428591f6b
3 changed files with 15 additions and 20 deletions
|
@ -2,16 +2,16 @@ import {test, expect} from 'vitest';
|
|||
import {showInfoToast, showErrorToast, showWarningToast} from './toast.js';
|
||||
|
||||
test('showInfoToast', async () => {
|
||||
await showInfoToast('success 😀', {duration: -1});
|
||||
showInfoToast('success 😀', {duration: -1});
|
||||
expect(document.querySelector('.toastify')).toBeTruthy();
|
||||
});
|
||||
|
||||
test('showWarningToast', async () => {
|
||||
await showWarningToast('warning 😐', {duration: -1});
|
||||
showWarningToast('warning 😐', {duration: -1});
|
||||
expect(document.querySelector('.toastify')).toBeTruthy();
|
||||
});
|
||||
|
||||
test('showErrorToast', async () => {
|
||||
await showErrorToast('error 🙁', {duration: -1});
|
||||
showErrorToast('error 🙁', {duration: -1});
|
||||
expect(document.querySelector('.toastify')).toBeTruthy();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue