Test config (#122)

* Automatically reset / clear mocks between tests

* Fix test for private view

* Fix tooltip test

* Fix router tests

* Fix all other tests
This commit is contained in:
Rijk van Zanten
2020-02-27 10:31:47 -05:00
committed by GitHub
parent 47649d29a4
commit ad459aa53a
7 changed files with 46 additions and 41 deletions

View File

@@ -8,13 +8,11 @@ describe('API', () => {
beforeAll(() => {
globalThis.window = Object.create(window);
Vue.use(VueCompositionAPI);
jest.spyOn(auth, 'logout');
jest.spyOn(auth, 'checkAuth');
});
beforeEach(() => {
(auth.logout as jest.Mock).mockClear();
(auth.checkAuth as jest.Mock).mockClear();
jest.spyOn(auth, 'logout');
jest.spyOn(auth, 'checkAuth');
});
it('Calculates the correct API root URL based on window', () => {