forgejo/web_src/js/modules/toast.test.js
Giteabot d74fba8175
Use vitest globals (#27102) (#27311)
Backport #27102 by @silverwind

Enable [globals](https://vitest.dev/config/#globals) in vitest, reducing
the noise in test files.

Co-authored-by: silverwind <me@silverwind.io>
2023-09-27 16:10:08 +02:00

16 lines
532 B
JavaScript

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();
});