+
diff --git a/src/setupTests.tsx b/src/setupTests.tsx
index 78150dc..cb5e536 100644
--- a/src/setupTests.tsx
+++ b/src/setupTests.tsx
@@ -13,6 +13,7 @@ import Adapter from "enzyme-adapter-react-16";
import "jest-enzyme";
import api from "./util/api";
import fetchMock from "fetch-mock";
+import "jest-localstorage-mock";
// Setup enzyme
configure({ adapter: new Adapter() });
@@ -29,11 +30,14 @@ jest.mock("react-i18next", () => ({
}
}));
-// Temporary fix to reset logged in state for each test.
-// The permanent fix would be to not use a global variable, and instead give this information to components through
-// props. Redux would be good for this, if we want to add it to the project.
beforeEach(() => {
+ // Temporary fix to reset logged in state for each test.
+ // The permanent fix would be to not use a global variable, and instead give this information to components through
+ // props. Redux would be good for this, if we want to add it to the project.
api.loggedIn = false;
+
+ // Clear local storage mock
+ localStorage.clear();
});
// Clear fetch mocks after each test