diff --git a/src/App.test.js b/src/App.test.js index 0a5f03a5..bdc32bdd 100644 --- a/src/App.test.js +++ b/src/App.test.js @@ -3,7 +3,15 @@ import App from "./App"; import Header from "./components/layout/Header/Header"; import Main from "./components/layout/Main/Main"; -// jest.mock("bootstrap-italia", () => ({ __esModule: true, default: jest.fn() })); +jest.mock("bootstrap-italia", () => { + return { + Modal: jest.fn().mockImplementation(() => { + return { + toggle: jest.fn() + }; + }) + }; +}); jest.mock("./components/layout/Header/Header", () => ({ __esModule: true, diff --git a/src/global-bootstrap-italia.js b/src/global-bootstrap-italia.js index 6a34583e..2047de47 100644 --- a/src/global-bootstrap-italia.js +++ b/src/global-bootstrap-italia.js @@ -1,6 +1,6 @@ +import { Modal } from "bootstrap-italia"; import jquery from "jquery"; import Popper from "popper.js"; -import Modal from "bootstrap/js/dist/modal"; window.__PUBLIC_PATH__ = "/fonts"; window.Popper = Popper;