mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-06 09:19:35 +00:00
a428591f6b
1. Do not use "async" 2. Call `hideToast` instead of `removeElement` for manual closing
17 lines
569 B
JavaScript
17 lines
569 B
JavaScript
import {test, expect} from 'vitest';
|
|
import {showInfoToast, showErrorToast, showWarningToast} from './toast.js';
|
|
|
|
test('showInfoToast', async () => {
|
|
showInfoToast('success 😀', {duration: -1});
|
|
expect(document.querySelector('.toastify')).toBeTruthy();
|
|
});
|
|
|
|
test('showWarningToast', async () => {
|
|
showWarningToast('warning 😐', {duration: -1});
|
|
expect(document.querySelector('.toastify')).toBeTruthy();
|
|
});
|
|
|
|
test('showErrorToast', async () => {
|
|
showErrorToast('error 🙁', {duration: -1});
|
|
expect(document.querySelector('.toastify')).toBeTruthy();
|
|
});
|