Skip to content

Commit

Permalink
fix(useDownloadForm): fix test by mocking analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Protheroe committed May 11, 2023
1 parent 670457b commit fe11881
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ jest.mock("../../../browser-lib/hubspot/forms/getHubspotUserToken", () => ({
default: (...args: []) => getHubspotUserToken(...args),
}));

const testPosthogDistinctId = "test-anonymous-id";

jest.mock("../../../context/Analytics/useAnalytics", () => ({
__esModule: true,
default: () => ({
posthogDistinctId: testPosthogDistinctId,
}),
}));

describe("useDownloadForm", () => {
beforeEach(() => {
jest.clearAllMocks();
Expand Down

0 comments on commit fe11881

Please sign in to comment.