Skip to content

Commit

Permalink
Mock out popover to clean test logging for SelectPreferredStore.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmchilton committed Nov 19, 2024
1 parent d388aa2 commit d8b21ef
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit d8b21ef

Please sign in to comment.