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>
1. Do not use "async" 2. Call `hideToast` instead of `removeElement` for manual closing
Fixes https://github.com/go-gitea/gitea/issues/24353 In some case like async success/error, it is useful to show toasts in UI.