Fixup server mocking in NotificationForm.test.ts.

The previous mock was not actually preventing that initial fetch against the API to get an openapi schema.
This commit is contained in:
John Chilton
2024-11-22 12:17:35 -05:00
parent 21b8b9e41a
commit 47ce2db3eb
@@ -5,9 +5,13 @@ import flushPromises from "flush-promises";
import { setActivePinia } from "pinia";
import type Vue from "vue";
import { useServerMock } from "@/api/client/__mocks__";
import NotificationForm from "./NotificationForm.vue";
jest.mock("@/api/schema");
// Even though we don't use the API endpoints, this seems to prevent failure fetching
// openapi during jest testing.
useServerMock();
const SUBMIT_BUTTON_SELECTOR = "#notification-submit";
@@ -46,5 +50,7 @@ describe("NotificationForm.vue", () => {
const { wrapper } = await mountNotificationForm();
expectSubmitButton(wrapper, false);
await flushPromises();
});
});