mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-11 04:05:10 +02:00
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