From d8b21ef2d70d9dd77c600e01b059da1dc9745481 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Tue, 19 Nov 2024 13:40:30 -0500 Subject: [PATCH] Mock out popover to clean test logging for SelectPreferredStore. --- .../History/CurrentHistory/SelectPreferredStore.test.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/client/src/components/History/CurrentHistory/SelectPreferredStore.test.ts b/client/src/components/History/CurrentHistory/SelectPreferredStore.test.ts index 7638ef43b918..c500afa2af64 100644 --- a/client/src/components/History/CurrentHistory/SelectPreferredStore.test.ts +++ b/client/src/components/History/CurrentHistory/SelectPreferredStore.test.ts @@ -3,6 +3,7 @@ import axios from "axios"; import MockAdapter from "axios-mock-adapter"; import flushPromises from "flush-promises"; import { getLocalVue } from "tests/jest/helpers"; +import { h } from "vue"; import { useServerMock } from "@/api/client/__mocks__"; import { ROOT_COMPONENT } from "@/utils/navigation/schema"; @@ -42,6 +43,13 @@ async function mountComponent() { const PREFERENCES = ROOT_COMPONENT.preferences; +// bootstrap vue will try to match targets to actual HTML elements in DOM but there +// may be no DOM for jest tests, just stub out an alternative minimal implementation. +jest.mock("@/components/ObjectStore/ObjectStoreSelectButtonPopover.vue", () => ({ + name: "ObjectStoreSelectButtonPopover", + render: () => h("div", "Mocked Popover"), +})); + describe("SelectPreferredStore.vue", () => { let axiosMock: MockAdapter;