-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Always vi.restoreAllMocks() before each test (#5788)
# Motivation To avoid unpredictable behavior, each test should start with a clean slate. One component of that is restoring all mocks before each test. This PR makes sure all mocks are restored before each test. I thought all tests were already prepared in earlier PRs but some were apparently missed on my first pass. This PR fixes all the remaining tests as well. A follow-up PR will remove now unnecessary calls to `vi.restroreAllMock()` from individual tests. # Changes 1. Call `vi.restoreAllMocks()` in `beforeEach` in `vitest.setup.ts`. 2. Fix all remaining tests that were missed before. # Tests All tests pass. # Todos - [ ] Add entry to changelog (if necessary). not necessary
- Loading branch information
Showing
8 changed files
with
50 additions
and
56 deletions.
There are no files selected for viewing
11 changes: 4 additions & 7 deletions
11
frontend/src/tests/lib/components/canister-detail/UnlinkctionButton.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters