Skip to content

Commit

Permalink
fix jest test
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminpochat committed Aug 19, 2024
1 parent b744e6a commit 91b2f03
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import renderer from 'react-test-renderer';
import BeefProductionCard from './BeefProductionCard';
import React from 'react';
import { ReactKeycloakProvider } from '@react-keycloak/web';
import Production from '@viandeendirect/api/dist/models/Production';

const mockedUsedNavigate = jest.fn();

jest.mock("@react-keycloak/web", () => ({ useKeycloak: mockUseKeycloak }));

jest.mock('react-router-dom', () => ({
...jest.requireActual('react-router-dom') as any,
useNavigate: () => mockedUsedNavigate,
}));

function mockUseKeycloak() {
const token = "A random string that is non zero length";
Expand Down

0 comments on commit 91b2f03

Please sign in to comment.