Skip to content

Commit

Permalink
fix test mock
Browse files Browse the repository at this point in the history
  • Loading branch information
frodehansen2 committed Oct 21, 2024
1 parent 3365917 commit 5e69a91
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ArbeiderIPeriodenSvar, TimerEllerProsent } from '../../../../types';
import { getArbeidstidSøknadsdataFromFormValues } from '../arbeidstidStepUtils';

vi.mock('@navikt/sif-common-env', () => {
return { getRequiredEnv: () => '', getEnv: () => '', commonEnv: {} };
return { getRequiredEnv: () => '', getEnv: () => '', getCommonEnv: () => ({}) };
});

describe('arbeidstidStepUtils', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { getEndringerForArbeidsukeForm } from '../arbeidsaktivitetUtils';
import { vi } from 'vitest';

vi.mock('@navikt/sif-common-env', () => {
return { getRequiredEnv: () => '', getEnv: () => '', commonEnv: {} };
return { getRequiredEnv: () => '', getEnv: () => '', getCommonEnv: () => ({}) };
});

describe('arbeidsaktivitetUtils', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const registrertBarn: RegistrertBarn = {
};

vi.mock('@navikt/sif-common-env', () => {
return { getRequiredEnv: () => '', commonEnv: {}, getEnv: () => '' };
return { getRequiredEnv: () => '', getCommonEnv: () => ({}), getEnv: () => '' };
});

describe('søknadStepConfig', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { getMinDatoForBarnetsFødselsdato, isBarnOver18år } from '../omBarnetSt
import { vi } from 'vitest';

vi.mock('@navikt/sif-common-env', () => {
return { getRequiredEnv: () => '', commonEnv: {}, getEnv: () => '' };
return { getRequiredEnv: () => '', getCommonEnv: () => ({}), getEnv: () => '' };
});

describe('isBarnOver18år', () => {
Expand Down
8 changes: 7 additions & 1 deletion apps/omsorgspengesoknad/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,11 @@
"typeRoots": ["../../node_modules/@types", "./node_modules/@types"]
},
"exclude": ["node_modules", "src/build", "**.js", "dist"],
"include": ["./src/app/**/*", "./src/storybook/**/*", "./e2e/playwright/*", "./playwright-config.ts", "./env.schema.ts"]]
"include": [
"./src/app/**/*",
"./src/storybook/**/*",
"./e2e/playwright/*",
"./playwright-config.ts",
"./env.schema.ts"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { navigateToErrorPage, userIsCurrentlyOnErrorPage } from '../navigationUt
const navigate: NavigateFunction = vi.fn().mockImplementation(() => {});

vi.mock('@navikt/sif-common-env', () => {
return { getRequiredEnv: () => '', commonEnv: { PUBLIC_PATH: '', SIF_PUBLIC_LOGIN_URL: '' } };
return { getRequiredEnv: () => '', getCommonEnv: () => ({ PUBLIC_PATH: '', SIF_PUBLIC_LOGIN_URL: '' }) };
});

const søknadstype = Søknadstype.omsorgspenger;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { vi } from 'vitest';
import { Attachment } from '../../types/Attachment';
import {
attachmentShouldBeProcessed,
Expand All @@ -14,7 +15,7 @@ const fileMock = new File([''], 'filename.png', { type: 'text/png' });
const invalidFileMock = new File([''], 'filename.docx', { type: 'text/png' });

vi.mock('@navikt/sif-common-env', () => ({
commonEnv: {},
getCommonEnv: () => ({}),
}));

describe('attachmentUtils', () => {
Expand Down

0 comments on commit 5e69a91

Please sign in to comment.