mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-30 11:04:14 +01:00 
			
		
		
		
	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>
		
			
				
	
	
		
			17 lines
		
	
	
		
			532 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			17 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();
 | |
| });
 |