From f6ce3daedb9002bfb6f03234c4b8961040ac0c38 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 22 Oct 2024 19:49:22 +0000 Subject: [PATCH 1/2] Bump http-proxy-middleware Bumps the npm_and_yarn group with 1 update in the /server directory: [http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware). Updates `http-proxy-middleware` from 3.0.0 to 3.0.3 - [Release notes](https://github.com/chimurai/http-proxy-middleware/releases) - [Changelog](https://github.com/chimurai/http-proxy-middleware/blob/master/CHANGELOG.md) - [Commits](https://github.com/chimurai/http-proxy-middleware/compare/v3.0.0...v3.0.3) --- updated-dependencies: - dependency-name: http-proxy-middleware dependency-type: direct:production dependency-group: npm_and_yarn ... Signed-off-by: dependabot[bot] --- server/package-lock.json | 111 +++++++++++++++++++-------------------- server/package.json | 2 +- 2 files changed, 55 insertions(+), 58 deletions(-) diff --git a/server/package-lock.json b/server/package-lock.json index eb239e8f6..55ec761aa 100644 --- a/server/package-lock.json +++ b/server/package-lock.json @@ -12,7 +12,7 @@ "@navikt/oasis": "3.4.0", "express": "^4.20.0", "express-http-proxy": "2.0.0", - "http-proxy-middleware": "3.0.0", + "http-proxy-middleware": "3.0.3", "http-terminator": "3.2.0", "jsdom": "^24.1.0", "mustache": "^4.2.0", @@ -147,9 +147,9 @@ "integrity": "sha512-e+2rjEwK6KDaNOm5Aa9wNGgyS9oSZU/4pfSMMPYNOfjvFI0WVXm29+ITRFr6aKDvvKo7uU1jV68MW4ScsfDi7Q==" }, "node_modules/@types/http-proxy": { - "version": "1.17.11", - "resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.11.tgz", - "integrity": "sha512-HC8G7c1WmaF2ekqpnFq626xd3Zz0uvaqFmBJNRZCGEZCXkvSdJoNFn/8Ygbd9fKNQj8UzLdCETaI0UWPAjK7IA==", + "version": "1.17.15", + "resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.15.tgz", + "integrity": "sha512-25g5atgiVNTIv0LBDTg1H74Hvayx0ajtJPLLcYE3whFv75J0pWNtOBzaXJQgDTmrX1bx5U9YC2w/n65BN1HwRQ==", "dependencies": { "@types/node": "*" } @@ -1009,27 +1009,27 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "node_modules/http-proxy-middleware": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-3.0.0.tgz", - "integrity": "sha512-36AV1fIaI2cWRzHo+rbcxhe3M3jUDCNzc4D5zRl57sEWRAxdXYtw7FSQKYY6PDKssiAKjLYypbssHk+xs/kMXw==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-3.0.3.tgz", + "integrity": "sha512-usY0HG5nyDUwtqpiZdETNbmKtw3QQ1jwYFZ9wi5iHzX2BcILwQKtYDJPo7XHTsu5Z0B2Hj3W9NNnbd+AjFWjqg==", "dependencies": { - "@types/http-proxy": "^1.17.10", - "debug": "^4.3.4", + "@types/http-proxy": "^1.17.15", + "debug": "^4.3.6", "http-proxy": "^1.18.1", - "is-glob": "^4.0.1", - "is-plain-obj": "^3.0.0", - "micromatch": "^4.0.5" + "is-glob": "^4.0.3", + "is-plain-object": "^5.0.0", + "micromatch": "^4.0.8" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/http-proxy-middleware/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -1041,9 +1041,9 @@ } }, "node_modules/http-proxy-middleware/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, "node_modules/http-terminator": { "version": "3.2.0", @@ -1124,15 +1124,15 @@ "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "engines": { "node": ">=0.10.0" } }, "node_modules/is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dependencies": { "is-extglob": "^2.1.1" }, @@ -1148,15 +1148,12 @@ "node": ">=0.12.0" } }, - "node_modules/is-plain-obj": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-3.0.0.tgz", - "integrity": "sha512-gwsOE28k+23GP1B6vFl1oVh/WOzmawBrKwo5Ev6wMKzPkaXaCDIQKzLnvsA42DRlbVTWorkgTKIviAKCWkfUwA==", + "node_modules/is-plain-object": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=0.10.0" } }, "node_modules/is-potential-custom-element-name": { @@ -2240,9 +2237,9 @@ "integrity": "sha512-e+2rjEwK6KDaNOm5Aa9wNGgyS9oSZU/4pfSMMPYNOfjvFI0WVXm29+ITRFr6aKDvvKo7uU1jV68MW4ScsfDi7Q==" }, "@types/http-proxy": { - "version": "1.17.11", - "resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.11.tgz", - "integrity": "sha512-HC8G7c1WmaF2ekqpnFq626xd3Zz0uvaqFmBJNRZCGEZCXkvSdJoNFn/8Ygbd9fKNQj8UzLdCETaI0UWPAjK7IA==", + "version": "1.17.15", + "resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.15.tgz", + "integrity": "sha512-25g5atgiVNTIv0LBDTg1H74Hvayx0ajtJPLLcYE3whFv75J0pWNtOBzaXJQgDTmrX1bx5U9YC2w/n65BN1HwRQ==", "requires": { "@types/node": "*" } @@ -2908,30 +2905,30 @@ } }, "http-proxy-middleware": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-3.0.0.tgz", - "integrity": "sha512-36AV1fIaI2cWRzHo+rbcxhe3M3jUDCNzc4D5zRl57sEWRAxdXYtw7FSQKYY6PDKssiAKjLYypbssHk+xs/kMXw==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-3.0.3.tgz", + "integrity": "sha512-usY0HG5nyDUwtqpiZdETNbmKtw3QQ1jwYFZ9wi5iHzX2BcILwQKtYDJPo7XHTsu5Z0B2Hj3W9NNnbd+AjFWjqg==", "requires": { - "@types/http-proxy": "^1.17.10", - "debug": "^4.3.4", + "@types/http-proxy": "^1.17.15", + "debug": "^4.3.6", "http-proxy": "^1.18.1", - "is-glob": "^4.0.1", - "is-plain-obj": "^3.0.0", - "micromatch": "^4.0.5" + "is-glob": "^4.0.3", + "is-plain-object": "^5.0.0", + "micromatch": "^4.0.8" }, "dependencies": { "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", "requires": { - "ms": "2.1.2" + "ms": "^2.1.3" } }, "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" } } }, @@ -2996,12 +2993,12 @@ "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==" }, "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "requires": { "is-extglob": "^2.1.1" } @@ -3011,10 +3008,10 @@ "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" }, - "is-plain-obj": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-3.0.0.tgz", - "integrity": "sha512-gwsOE28k+23GP1B6vFl1oVh/WOzmawBrKwo5Ev6wMKzPkaXaCDIQKzLnvsA42DRlbVTWorkgTKIviAKCWkfUwA==" + "is-plain-object": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==" }, "is-potential-custom-element-name": { "version": "1.0.1", diff --git a/server/package.json b/server/package.json index a1b4a14f3..552335dba 100644 --- a/server/package.json +++ b/server/package.json @@ -8,7 +8,7 @@ "@navikt/oasis": "3.4.0", "express": "^4.20.0", "express-http-proxy": "2.0.0", - "http-proxy-middleware": "3.0.0", + "http-proxy-middleware": "3.0.3", "http-terminator": "3.2.0", "jsdom": "^24.1.0", "mustache": "^4.2.0", From 07ea4331997e60a502b9832b4aed6d829239c48e Mon Sep 17 00:00:00 2001 From: Ken Gullaksen Date: Fri, 1 Nov 2024 07:53:28 +0100 Subject: [PATCH 2/2] oppdater til ny kontrakt for altinntilganger --- package-lock.json | 9 ++--- package.json | 2 +- src/hooks/useUserInfo.ts | 10 ++--- src/mocks/scenarios/dagligLederScenario.ts | 40 +++++++++---------- .../n\303\246rmesteLederScenario.ts" | 34 +++++++--------- src/mocks/scenarios/regnskapsforerScenario.ts | 18 ++++----- src/tests/mocks.ts | 30 +++++++------- 7 files changed, 69 insertions(+), 74 deletions(-) diff --git a/package-lock.json b/package-lock.json index 97d74956f..4ccf88938 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "@grafana/faro-web-sdk": "1.3.6", "@navikt/aksel-icons": "^5.17.2", "@navikt/arbeidsgiver-notifikasjon-widget": "7.1.2", - "@navikt/bedriftsmeny": "7.0.1", + "@navikt/bedriftsmeny": "7.0.3", "@navikt/ds-css": "^6.15.0", "@navikt/ds-icons": "3.4.3", "@navikt/ds-react": "^6.15.0", @@ -5051,10 +5051,9 @@ } }, "node_modules/@navikt/bedriftsmeny": { - "version": "7.0.1", - "resolved": "https://npm.pkg.github.com/download/@navikt/bedriftsmeny/7.0.1/14b74622f4063cff56242a25fbda807a099207b2", - "integrity": "sha512-JAhPJjelkkNcJgf+wMoQkGzM9j66/wNrR/mEGetMtccXltymVbZFD7DVXF+8cEK5pXuXwnEbvdmdoCSJw7j2/Q==", - "license": "MIT", + "version": "7.0.3", + "resolved": "https://npm.pkg.github.com/download/@navikt/bedriftsmeny/7.0.3/ddebffde12356069fb5590ca71a12ec6b9372180", + "integrity": "sha512-1jErlbYsLTczkJxMm5+3xghpc0gad3ehEJkRzUdXMU/omD/W0fdhjgKcXbAmO2FUuQ/7a5IpV+nCkQbgSAmQ3g==", "dependencies": { "focus-trap-react": "^10.2.2", "fuzzysort": "^1.1.4", diff --git a/package.json b/package.json index c71211d07..b9a7b3788 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "@grafana/faro-web-sdk": "1.3.6", "@navikt/aksel-icons": "^5.17.2", "@navikt/arbeidsgiver-notifikasjon-widget": "7.1.2", - "@navikt/bedriftsmeny": "7.0.1", + "@navikt/bedriftsmeny": "7.0.3", "@navikt/ds-css": "^6.15.0", "@navikt/ds-icons": "3.4.3", "@navikt/ds-react": "^6.15.0", diff --git a/src/hooks/useUserInfo.ts b/src/hooks/useUserInfo.ts index 5fe8ec221..94fe5bf79 100644 --- a/src/hooks/useUserInfo.ts +++ b/src/hooks/useUserInfo.ts @@ -6,7 +6,7 @@ import * as Record from '../utils/Record'; import { Set } from 'immutable'; import { useState } from 'react'; import { erDriftsforstyrrelse } from '../utils/util'; -import { flatUtOrganisasjonstre } from '@navikt/bedriftsmeny'; +import { flatUtOrganisasjonstreV2 } from '@navikt/bedriftsmeny'; const DigiSyfoOrganisasjon = z.object({ organisasjon: Organisasjon, @@ -37,9 +37,9 @@ const idLookup = (id: string) => tjenesteTilIdMap[id] ?? id; // recursive type using zod https://zodjs.netlify.app/guide/recursive-types#recursive-types const BaseAltinnTilgang = z.object({ - orgNr: z.string(), - name: z.string(), - organizationForm: z.string(), + orgnr: z.string(), + navn: z.string(), + organisasjonsform: z.string(), }); export type AltinnTilgang = z.infer & { underenheter: AltinnTilgang[]; @@ -52,7 +52,7 @@ const UserInfoRespons = z.object({ digisyfoError: z.boolean(), organisasjoner: z .array(AltinnTilgang) - .transform((organisasjoner) => flatUtOrganisasjonstre(organisasjoner)), + .transform((organisasjoner) => flatUtOrganisasjonstreV2(organisasjoner)), tilganger: z.record(z.string(), z.array(z.string())).transform((tilganger) => { return Record.fromEntries( Object.entries(tilganger).map(([id, orgnumre]) => [idLookup(id), Set(orgnumre)]) diff --git a/src/mocks/scenarios/dagligLederScenario.ts b/src/mocks/scenarios/dagligLederScenario.ts index c5f0c25d6..edc598adf 100644 --- a/src/mocks/scenarios/dagligLederScenario.ts +++ b/src/mocks/scenarios/dagligLederScenario.ts @@ -36,48 +36,48 @@ export const dagligLederScenario = [ http.get('/min-side-arbeidsgiver/api/userInfo/v2', () => { const underenheter = [ { - orgNr: orgnr(), + orgnr: orgnr(), underenheter: [], - name: faker.company.name(), - organizationForm: 'AAFY', + navn: faker.company.name(), + organisasjonsform: 'AAFY', }, { - orgNr: orgnr(), + orgnr: orgnr(), underenheter: [], - name: faker.company.name(), - organizationForm: 'FLI', + navn: faker.company.name(), + organisasjonsform: 'FLI', }, { - orgNr: orgnr(), - name: faker.company.name(), - organizationForm: 'BEDR', + orgnr: orgnr(), + navn: faker.company.name(), + organisasjonsform: 'BEDR', underenheter: [], }, ]; const organisasjon = { - orgNr: orgnr(), - name: faker.company.name(), - organizationForm: 'AS', + orgnr: orgnr(), + navn: faker.company.name(), + organisasjonsform: 'AS', underenheter, }; return HttpResponse.json({ altinnError: false, organisasjoner: [organisasjon], tilganger: fromEntries( - alleTilganger.map((tilgang) => [tilgang, underenheter.map((org) => org.orgNr)]) + alleTilganger.map((tilgang) => [tilgang, underenheter.map((org) => org.orgnr)]) ), digisyfoError: false, - digisyfoOrganisasjoner: underenheter.map(({ orgNr, organizationForm, name }) => ({ + digisyfoOrganisasjoner: underenheter.map(({ orgnr, organisasjonsform, navn }) => ({ organisasjon: { - OrganizationNumber: orgNr, - Name: name, - ParentOrganizationNumber: organisasjon.orgNr, - OrganizationForm: organizationForm, + OrganizationNumber: orgnr, + Name: navn, + ParentOrganizationNumber: organisasjon.orgnr, + OrganizationForm: organisasjonsform, }, antallSykmeldte: faker.number.int({ min: 0, max: 10 }), })), - refusjoner: underenheter.map(({ orgNr }) => ({ - virksomhetsnummer: orgNr, + refusjoner: underenheter.map(({ orgnr }) => ({ + virksomhetsnummer: orgnr, statusoversikt: { KLAR_FOR_INNSENDING: faker.number.int({ min: 0, max: 10 }), FOR_TIDLIG: faker.number.int({ min: 0, max: 10 }), diff --git "a/src/mocks/scenarios/n\303\246rmesteLederScenario.ts" "b/src/mocks/scenarios/n\303\246rmesteLederScenario.ts" index 9e2ff057b..01c646e4f 100644 --- "a/src/mocks/scenarios/n\303\246rmesteLederScenario.ts" +++ "b/src/mocks/scenarios/n\303\246rmesteLederScenario.ts" @@ -28,39 +28,35 @@ export const nærmesteLederScenario = [ http.get('/min-side-arbeidsgiver/api/userInfo/v2', () => { const underenheter = [ { - orgNr: orgnr(), - name: faker.company.name(), - organizationForm: 'BEDR', + orgnr: orgnr(), + navn: faker.company.name(), + organisasjonsform: 'BEDR', underenheter: [], }, { - orgNr: orgnr(), - name: faker.company.name(), - organizationForm: 'BEDR', + orgnr: orgnr(), + navn: faker.company.name(), + organisasjonsform: 'BEDR', underenheter: [], }, ]; const organisasjon = { - orgNr: orgnr(), - name: faker.company.name(), - organizationForm: 'AS', + orgnr: orgnr(), + navn: faker.company.name(), + organisasjonsform: 'AS', underenheter, }; return HttpResponse.json({ altinnError: false, organisasjoner: [organisasjon], - tilganger: fromEntries( - [ - // TODO: skal nærmeste leder ha noen altinn tilganger? - ].map((tilgang) => [tilgang, underenheter.map((org) => org.orgNr)]) - ), + tilganger: {}, digisyfoError: false, - digisyfoOrganisasjoner: underenheter.map(({ orgNr, organizationForm, name }) => ({ + digisyfoOrganisasjoner: underenheter.map(({ orgnr, organisasjonsform, navn }) => ({ organisasjon: { - OrganizationNumber: orgNr, - Name: name, - ParentOrganizationNumber: organisasjon.orgNr, - OrganizationForm: organizationForm, + OrganizationNumber: orgnr, + Name: navn, + ParentOrganizationNumber: organisasjon.orgnr, + OrganizationForm: organisasjonsform, }, antallSykmeldte: faker.number.int({ min: 0, max: 10 }), })), diff --git a/src/mocks/scenarios/regnskapsforerScenario.ts b/src/mocks/scenarios/regnskapsforerScenario.ts index 891dfd1dd..eb5ac4da4 100644 --- a/src/mocks/scenarios/regnskapsforerScenario.ts +++ b/src/mocks/scenarios/regnskapsforerScenario.ts @@ -24,15 +24,15 @@ const tilganger = [ const regnskapsforerUserInfoScenario = http.get('/min-side-arbeidsgiver/api/userInfo/v2', () => { const underenheter: AltinnTilgang[] = []; const organisasjoner = Array.from({ length: 100 }).map(() => ({ - orgNr: orgnr(), - name: faker.company.name(), - organizationForm: 'AS', + orgnr: orgnr(), + navn: faker.company.name(), + organisasjonsform: 'AS', underenheter: Array.from({ length: faker.number.int({ min: 0, max: 5 }) }).map(() => { const underenhet = { - orgNr: orgnr(), + orgnr: orgnr(), underenheter: [], - name: faker.company.name(), - organizationForm: 'BEDR', + navn: faker.company.name(), + organisasjonsform: 'BEDR', }; underenheter.push(underenhet); return underenhet; @@ -42,12 +42,12 @@ const regnskapsforerUserInfoScenario = http.get('/min-side-arbeidsgiver/api/user altinnError: false, organisasjoner: organisasjoner, tilganger: fromEntries( - tilganger.map((tilgang) => [tilgang, underenheter.map((org) => org.orgNr)]) + tilganger.map((tilgang) => [tilgang, underenheter.map((org) => org.orgnr)]) ), digisyfoError: false, digisyfoOrganisasjoner: [], - refusjoner: underenheter.map(({ orgNr }) => ({ - virksomhetsnummer: orgNr, + refusjoner: underenheter.map(({ orgnr }) => ({ + virksomhetsnummer: orgnr, statusoversikt: { KLAR_FOR_INNSENDING: faker.number.int({ min: 0, max: 10 }) }, tilgang: true, })), diff --git a/src/tests/mocks.ts b/src/tests/mocks.ts index 4f16b56bc..68767f78c 100644 --- a/src/tests/mocks.ts +++ b/src/tests/mocks.ts @@ -9,35 +9,35 @@ export const server = setupServer( altinnError: false, organisasjoner: [ { - orgNr: orgnr(), + orgnr: orgnr(), underenheter: [ { - orgNr: '182345674', + orgnr: '182345674', underenheter: [], - name: faker.company.name(), - organizationForm: 'BEDR', + navn: faker.company.name(), + organisasjonsform: 'BEDR', }, { - orgNr: '118345674', + orgnr: '118345674', underenheter: [], - name: faker.company.name(), - organizationForm: 'BEDR', + navn: faker.company.name(), + organisasjonsform: 'BEDR', }, { - orgNr: '119985432', + orgnr: '119985432', underenheter: [], - name: faker.company.name(), - organizationForm: 'BEDR', + navn: faker.company.name(), + organisasjonsform: 'BEDR', }, { - orgNr: '119988432', + orgnr: '119988432', underenheter: [], - name: faker.company.name(), - organizationForm: 'BEDR', + navn: faker.company.name(), + organisasjonsform: 'BEDR', }, ], - name: faker.company.name(), - organizationForm: 'AS', + navn: faker.company.name(), + organisasjonsform: 'AS', }, ], tilganger: {