Skip to content

Commit

Permalink
Fixup server mocking in NotificationForm.test.ts.
Browse files Browse the repository at this point in the history
The previous mock was not actually preventing that initial fetch against the API to get an openapi schema.
  • Loading branch information
jmchilton committed Nov 22, 2024
1 parent 21b8b9e commit 47ce2db
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -46,5 +50,7 @@ describe("NotificationForm.vue", () => {
const { wrapper } = await mountNotificationForm();

expectSubmitButton(wrapper, false);

await flushPromises();
});
});

0 comments on commit 47ce2db

Please sign in to comment.