Skip to content

Commit

Permalink
Introduserer spesifikk funksjon for å sette i gang mocking
Browse files Browse the repository at this point in the history
  • Loading branch information
terjeofnorway committed Jul 25, 2024
1 parent 5e6c560 commit 4439f97
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion example/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useState } from 'react';
import { Miljo } from '../../src/types/miljo';
import { DetaljertArbeidsforhold, ListeMedArbeidsforhold } from '@navikt/arbeidsforhold';
import { DetaljertArbeidsforhold, ListeMedArbeidsforhold, initLocalMock } from '@navikt/arbeidsforhold';
import { InfoBoks } from './components/InfoBoks';
import { SprakVelger } from './components/SprakVelger';
import { BrowserRouter as Router, Link } from 'react-router-dom';
Expand All @@ -17,6 +17,8 @@ const App = () => {
const isDev = host.split(`.`)[1] === 'dev';
const miljo = (isDev ? 'DEV' : 'LOCAL') as Miljo;

initLocalMock();

const printActivated = true;
const printName = 'Ola Nordmann';
const printSSN = '12345678911';
Expand Down
6 changes: 3 additions & 3 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import ListeMedArbeidsforhold, { AFListeOnClick } from './modules/af-liste';
import DetaljertArbeidsforhold from './modules/af-detaljert';
import './language/provider';

if (import.meta.env.VITE_ENV === 'local') {
const initLocalMock = () => {
Environment.settEnv('LOCAL');
setUpMock();
}
};

export { ListeMedArbeidsforhold, DetaljertArbeidsforhold, AFListeOnClick };
export { ListeMedArbeidsforhold, DetaljertArbeidsforhold, AFListeOnClick, initLocalMock };

0 comments on commit 4439f97

Please sign in to comment.