mirror of
https://github.com/go-gitea/gitea
synced 2024-11-09 03:21:45 +01: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();
|
|
});
|