Bug 1573408 - Restore mock in jest tests r=Ola,sole

Differential Revision: https://phabricator.services.mozilla.com/D41982

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Belén Albeza 2019-08-19 08:52:41 +00:00
parent 5f76ecca6e
commit e3e7c0ffca

View File

@ -7,8 +7,6 @@
const { shallow } = require("enzyme");
const { createFactory } = require("react");
console.error = jest.fn();
// Import setupStore with imported & combined reducers
const {
setupStore,
@ -35,10 +33,18 @@ describe("PageSwitcher", () => {
});
}
const consoleErrorSpy = jest
.spyOn(console, "error")
.mockImplementation(() => {});
beforeEach(() => {
console.error.mockClear();
});
afterAll(() => {
consoleErrorSpy.mockRestore();
});
it("renders the ManifestPage component when manifest page is selected", () => {
const store = buildStoreWithSelectedPage(PAGE_TYPES.MANIFEST);
const wrapper = shallow(PageSwitcher({ store })).dive();