diff --git a/cypress/e2e/pensjon/kalkulator/henvisning.cy.ts b/cypress/e2e/pensjon/kalkulator/henvisning.cy.ts index c5b0b28e7..e38fe1e92 100644 --- a/cypress/e2e/pensjon/kalkulator/henvisning.cy.ts +++ b/cypress/e2e/pensjon/kalkulator/henvisning.cy.ts @@ -6,11 +6,21 @@ describe('Henvisning', () => { return false }) cy.intercept( - { method: 'GET', url: '/pensjon/kalkulator/api/v2/person' }, + { method: 'GET', url: '/pensjon/kalkulator/api/v4/person' }, { navn: 'Aprikos', sivilstand: 'UGIFT', foedselsdato: '1960-04-30', + pensjoneringAldre: { + normertPensjoneringsalder: { + aar: 67, + maaneder: 0, + }, + nedreAldersgrense: { + aar: 62, + maaneder: 0, + }, + }, } ).as('getPerson') diff --git a/cypress/e2e/pensjon/kalkulator/hovedhistorie.cy.ts b/cypress/e2e/pensjon/kalkulator/hovedhistorie.cy.ts index 9c3167644..ba46de27b 100644 --- a/cypress/e2e/pensjon/kalkulator/hovedhistorie.cy.ts +++ b/cypress/e2e/pensjon/kalkulator/hovedhistorie.cy.ts @@ -116,11 +116,21 @@ describe('Hovedhistorie', () => { describe('Når jeg navigerer videre fra /start til neste steg,', () => { beforeEach(() => { cy.intercept( - { method: 'GET', url: '/pensjon/kalkulator/api/v2/person' }, + { method: 'GET', url: '/pensjon/kalkulator/api/v4/person' }, { navn: 'Aprikos', sivilstand: 'GIFT', foedselsdato: '1963-04-30', + pensjoneringAldre: { + normertPensjoneringsalder: { + aar: 67, + maaneder: 0, + }, + nedreAldersgrense: { + aar: 62, + maaneder: 0, + }, + }, } ).as('getPerson') cy.login() @@ -314,7 +324,7 @@ describe('Hovedhistorie', () => { }) it('ønsker jeg som er født fom. 1964 informasjon om når jeg tidligst kan starte uttak av pensjon.', () => { cy.intercept( - { method: 'GET', url: '/pensjon/kalkulator/api/v2/person' }, + { method: 'GET', url: '/pensjon/kalkulator/api/v4/person' }, { navn: 'Aprikos', sivilstand: 'UGIFT', diff --git a/cypress/fixtures/person.json b/cypress/fixtures/person.json index 2cca124a0..190f67069 100644 --- a/cypress/fixtures/person.json +++ b/cypress/fixtures/person.json @@ -1,5 +1,15 @@ { "navn": "Aprikos", "sivilstand": "UGIFT", - "foedselsdato": "1963-04-30" + "foedselsdato": "1963-04-30", + "pensjoneringAldre": { + "normertPensjoneringsalder": { + "aar": 67, + "maaneder": 0 + }, + "nedreAldersgrense": { + "aar": 62, + "maaneder": 0 + } + } } diff --git a/cypress/support/e2e.ts b/cypress/support/e2e.ts index 949dc3f7e..794158816 100644 --- a/cypress/support/e2e.ts +++ b/cypress/support/e2e.ts @@ -112,7 +112,7 @@ beforeEach(() => { ).as('getLoependeVedtak') cy.intercept( - { method: 'GET', url: '/pensjon/kalkulator/api/v2/person' }, + { method: 'GET', url: '/pensjon/kalkulator/api/v4/person' }, { fixture: 'person.json' } ).as('getPerson') diff --git a/package-lock.json b/package-lock.json index 5bbe9c7a5..83aa9eed0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "name": "pensjonskalkulator-frontend", "version": "0.0.0", "dependencies": { - "@amplitude/analytics-browser": "^2.11.9", + "@amplitude/analytics-browser": "^2.11.10", "@elastic/ecs-winston-format": "^1.5.3", "@navikt/oasis": "^3.6.0", "express": "^4.21.2", @@ -45,19 +45,19 @@ "@vitest/ui": "^2.1.4", "axe-core": "^4.10.2", "clsx": "^2.1.1", - "cypress": "^13.16.1", + "cypress": "^13.17.0", "cypress-axe": "^1.4.0", "date-fns": "^4.1.0", "eslint": "^9.17.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-import": "^2.31.0", - "globals": "^15.13.0", + "globals": "^15.14.0", "highcharts": "^11.4.8", "highcharts-react-official": "^3.2.1", "husky": "^9.1.7", "jsdom": "^25.0.1", "lint-staged": "^15.2.11", - "msw": "^2.6.8", + "msw": "^2.7.0", "node-sass": "^9.0.0", "openapi-typescript": "^7.4.4", "postcss": "^8.4.49", @@ -79,8 +79,8 @@ "stylelint-config-standard-scss": "^14.0.0", "timers": "^0.1.1", "typescript": "^5.7.2", - "typescript-eslint": "^8.18.0", - "vite": "^6.0.3", + "typescript-eslint": "^8.18.1", + "vite": "^6.0.4", "vite-plugin-eslint": "^1.8.1", "vite-plugin-sass-dts": "^1.3.29", "vite-plugin-stylelint": "^6.0.0", @@ -95,26 +95,26 @@ "dev": true }, "node_modules/@amplitude/analytics-browser": { - "version": "2.11.9", - "resolved": "https://registry.npmjs.org/@amplitude/analytics-browser/-/analytics-browser-2.11.9.tgz", - "integrity": "sha512-FHejpsW3OypNKaIBvMwLm74UUSBcR+VwrBsj7V2VlPDNRdeaFi21kJgVYUW5AcjxTsadMzBQGBb4BarZ4k2+9Q==", + "version": "2.11.10", + "resolved": "https://registry.npmjs.org/@amplitude/analytics-browser/-/analytics-browser-2.11.10.tgz", + "integrity": "sha512-+bc+KvAvrFTQefmq+iGDuzdtPdJm9HXHPI58yTnHJeXhXDhneH8cGmT6dfL1SvW/W2kGvBdFXiZMoPuHcR0xKg==", "dependencies": { - "@amplitude/analytics-client-common": "^2.3.5", - "@amplitude/analytics-core": "^2.5.4", + "@amplitude/analytics-client-common": "^2.3.6", + "@amplitude/analytics-core": "^2.5.5", "@amplitude/analytics-remote-config": "^0.4.0", "@amplitude/analytics-types": "^2.8.4", "@amplitude/plugin-autocapture-browser": "^1.0.2", - "@amplitude/plugin-page-view-tracking-browser": "^2.3.5", + "@amplitude/plugin-page-view-tracking-browser": "^2.3.6", "tslib": "^2.4.1" } }, "node_modules/@amplitude/analytics-client-common": { - "version": "2.3.5", - "resolved": "https://registry.npmjs.org/@amplitude/analytics-client-common/-/analytics-client-common-2.3.5.tgz", - "integrity": "sha512-BCP+jorfLMAKK/g87fAk4IPP/NzQLMCep+Qe23tqOCWguwTEINYnyzD/GmhaIKXSM2o9pmMLlHbhkA1vXUtF8g==", + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/@amplitude/analytics-client-common/-/analytics-client-common-2.3.6.tgz", + "integrity": "sha512-4KAaqevqzYJIUzgjBmH80QDmYgzUAE0JpKz2s7w6cjeoX9DrB1gBa+RqWySULiUeIDfx+DTlhsZPMzFn+og17w==", "dependencies": { "@amplitude/analytics-connector": "^1.4.8", - "@amplitude/analytics-core": "^2.5.4", + "@amplitude/analytics-core": "^2.5.5", "@amplitude/analytics-types": "^2.8.4", "tslib": "^2.4.1" } @@ -125,9 +125,9 @@ "integrity": "sha512-T8mOYzB9RRxckzhL0NTHwdge9xuFxXEOplC8B1Y3UX3NHa3BLh7DlBUZlCOwQgMc2nxDfnSweDL5S3bhC+W90g==" }, "node_modules/@amplitude/analytics-core": { - "version": "2.5.4", - "resolved": "https://registry.npmjs.org/@amplitude/analytics-core/-/analytics-core-2.5.4.tgz", - "integrity": "sha512-J5ZF8hQmxmxM+7bu25a2TfTnk/LQ/oH5FYdg79f1lJ85Aa6oUlCDxgvXwy1RVpwaFjWlZQgV4XVaAUrxtSPRFw==", + "version": "2.5.5", + "resolved": "https://registry.npmjs.org/@amplitude/analytics-core/-/analytics-core-2.5.5.tgz", + "integrity": "sha512-OSB1WSD6qYoHyHliZaSujyatik2SP+vtoy8Y0vgRdYIpbE24F2q+SwBF3X5A1IeUqZ5fdpz+BNMwwUVl0Z4Ykg==", "dependencies": { "@amplitude/analytics-types": "^2.8.4", "tslib": "^2.4.1" @@ -163,11 +163,11 @@ } }, "node_modules/@amplitude/plugin-page-view-tracking-browser": { - "version": "2.3.5", - "resolved": "https://registry.npmjs.org/@amplitude/plugin-page-view-tracking-browser/-/plugin-page-view-tracking-browser-2.3.5.tgz", - "integrity": "sha512-qcV4DLxRAZRriYBNvjc2PGW1EDad6PSsIXmxVs6j8i9fxY2SfdvsFd/Qd23CHj1e6Dt5QpAVJZpUMCEdqqDZbA==", + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/@amplitude/plugin-page-view-tracking-browser/-/plugin-page-view-tracking-browser-2.3.6.tgz", + "integrity": "sha512-3NsXskUxIA9m4GedGOCIKOkQ1uGUhuYnP/DpvSXXosJEMRSi82vFxBRX7FnYT1AmV32Du2Z2626CEAEy5W4yeQ==", "dependencies": { - "@amplitude/analytics-client-common": "^2.3.5", + "@amplitude/analytics-client-common": "^2.3.6", "@amplitude/analytics-types": "^2.8.4", "tslib": "^2.4.1" } @@ -3443,17 +3443,16 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.18.0.tgz", - "integrity": "sha512-NR2yS7qUqCL7AIxdJUQf2MKKNDVNaig/dEB0GBLU7D+ZdHgK1NoH/3wsgO3OnPVipn51tG3MAwaODEGil70WEw==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.18.1.tgz", + "integrity": "sha512-Ncvsq5CT3Gvh+uJG0Lwlho6suwDfUXH0HztslDf5I+F2wAFAZMRwYLEorumpKLzmO2suAXZ/td1tBg4NZIi9CQ==", "dev": true, - "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.18.0", - "@typescript-eslint/type-utils": "8.18.0", - "@typescript-eslint/utils": "8.18.0", - "@typescript-eslint/visitor-keys": "8.18.0", + "@typescript-eslint/scope-manager": "8.18.1", + "@typescript-eslint/type-utils": "8.18.1", + "@typescript-eslint/utils": "8.18.1", + "@typescript-eslint/visitor-keys": "8.18.1", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", @@ -3473,16 +3472,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.18.0.tgz", - "integrity": "sha512-hgUZ3kTEpVzKaK3uNibExUYm6SKKOmTU2BOxBSvOYwtJEPdVQ70kZJpPjstlnhCHcuc2WGfSbpKlb/69ttyN5Q==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.18.1.tgz", + "integrity": "sha512-rBnTWHCdbYM2lh7hjyXqxk70wvon3p2FyaniZuey5TrcGBpfhVp0OxOa6gxr9Q9YhZFKyfbEnxc24ZnVbbUkCA==", "dev": true, - "license": "MITClause", "dependencies": { - "@typescript-eslint/scope-manager": "8.18.0", - "@typescript-eslint/types": "8.18.0", - "@typescript-eslint/typescript-estree": "8.18.0", - "@typescript-eslint/visitor-keys": "8.18.0", + "@typescript-eslint/scope-manager": "8.18.1", + "@typescript-eslint/types": "8.18.1", + "@typescript-eslint/typescript-estree": "8.18.1", + "@typescript-eslint/visitor-keys": "8.18.1", "debug": "^4.3.4" }, "engines": { @@ -3498,14 +3496,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.18.0.tgz", - "integrity": "sha512-PNGcHop0jkK2WVYGotk/hxj+UFLhXtGPiGtiaWgVBVP1jhMoMCHlTyJA+hEj4rszoSdLTK3fN4oOatrL0Cp+Xw==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.18.1.tgz", + "integrity": "sha512-HxfHo2b090M5s2+/9Z3gkBhI6xBH8OJCFjH9MhQ+nnoZqxU3wNxkLT+VWXWSFWc3UF3Z+CfPAyqdCTdoXtDPCQ==", "dev": true, - "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.18.0", - "@typescript-eslint/visitor-keys": "8.18.0" + "@typescript-eslint/types": "8.18.1", + "@typescript-eslint/visitor-keys": "8.18.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -3516,14 +3513,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.18.0.tgz", - "integrity": "sha512-er224jRepVAVLnMF2Q7MZJCq5CsdH2oqjP4dT7K6ij09Kyd+R21r7UVJrF0buMVdZS5QRhDzpvzAxHxabQadow==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.18.1.tgz", + "integrity": "sha512-jAhTdK/Qx2NJPNOTxXpMwlOiSymtR2j283TtPqXkKBdH8OAMmhiUfP0kJjc/qSE51Xrq02Gj9NY7MwK+UxVwHQ==", "dev": true, - "license": "MIT", "dependencies": { - "@typescript-eslint/typescript-estree": "8.18.0", - "@typescript-eslint/utils": "8.18.0", + "@typescript-eslint/typescript-estree": "8.18.1", + "@typescript-eslint/utils": "8.18.1", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, @@ -3540,11 +3536,10 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.18.0.tgz", - "integrity": "sha512-FNYxgyTCAnFwTrzpBGq+zrnoTO4x0c1CKYY5MuUTzpScqmY5fmsh2o3+57lqdI3NZucBDCzDgdEbIaNfAjAHQA==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.18.1.tgz", + "integrity": "sha512-7uoAUsCj66qdNQNpH2G8MyTFlgerum8ubf21s3TSM3XmKXuIn+H2Sifh/ES2nPOPiYSRJWAk0fDkW0APBWcpfw==", "dev": true, - "license": "MIT", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, @@ -3554,14 +3549,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.18.0.tgz", - "integrity": "sha512-rqQgFRu6yPkauz+ms3nQpohwejS8bvgbPyIDq13cgEDbkXt4LH4OkDMT0/fN1RUtzG8e8AKJyDBoocuQh8qNeg==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.18.1.tgz", + "integrity": "sha512-z8U21WI5txzl2XYOW7i9hJhxoKKNG1kcU4RzyNvKrdZDmbjkmLBo8bgeiOJmA06kizLI76/CCBAAGlTlEeUfyg==", "dev": true, - "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.18.0", - "@typescript-eslint/visitor-keys": "8.18.0", + "@typescript-eslint/types": "8.18.1", + "@typescript-eslint/visitor-keys": "8.18.1", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -3585,7 +3579,6 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, - "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } @@ -3595,7 +3588,6 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, - "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -3611,7 +3603,6 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "dev": true, - "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -3620,16 +3611,15 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.18.0.tgz", - "integrity": "sha512-p6GLdY383i7h5b0Qrfbix3Vc3+J2k6QWw6UMUeY5JGfm3C5LbZ4QIZzJNoNOfgyRe0uuYKjvVOsO/jD4SJO+xg==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.18.1.tgz", + "integrity": "sha512-8vikiIj2ebrC4WRdcAdDcmnu9Q/MXXwg+STf40BVfT8exDqBCUPdypvzcUPxEqRGKg9ALagZ0UWcYCtn+4W2iQ==", "dev": true, - "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.18.0", - "@typescript-eslint/types": "8.18.0", - "@typescript-eslint/typescript-estree": "8.18.0" + "@typescript-eslint/scope-manager": "8.18.1", + "@typescript-eslint/types": "8.18.1", + "@typescript-eslint/typescript-estree": "8.18.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -3644,13 +3634,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.18.0.tgz", - "integrity": "sha512-pCh/qEA8Lb1wVIqNvBke8UaRjJ6wrAWkJO5yyIbs8Yx6TNGYyfNjOo61tLv+WwLvoLPp4BQ8B7AHKijl8NGUfw==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.18.1.tgz", + "integrity": "sha512-Vj0WLm5/ZsD013YeUKn+K0y8p1M0jPpxOkKdbD1wB0ns53a5piVY02zjf072TblEweAbcYiFiPoSMF3kp+VhhQ==", "dev": true, - "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.18.0", + "@typescript-eslint/types": "8.18.1", "eslint-visitor-keys": "^4.2.0" }, "engines": { @@ -5141,9 +5130,9 @@ "dev": true }, "node_modules/cypress": { - "version": "13.16.1", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.16.1.tgz", - "integrity": "sha512-17FtCaz0cx7ssWYKXzGB0Vub8xHwpVPr+iPt2fHhLMDhVAPVrplD+rTQsZUsfb19LVBn5iwkEUFjQ1yVVJXsLA==", + "version": "13.17.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.17.0.tgz", + "integrity": "sha512-5xWkaPurwkIljojFidhw8lFScyxhtiFHl/i/3zov+1Z5CmY4t9tjIdvSXfu82Y3w7wt0uR9KkucbhkVvJZLQSA==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -7085,11 +7074,10 @@ } }, "node_modules/globals": { - "version": "15.13.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-15.13.0.tgz", - "integrity": "sha512-49TewVEz0UxZjr1WYYsWpPrhyC/B/pA8Bq0fUmet2n+eR7yn0IvNzNaoBwnK6mdkzcN+se7Ez9zUgULTz2QH4g==", + "version": "15.14.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-15.14.0.tgz", + "integrity": "sha512-OkToC372DtlQeje9/zHIo5CT8lRP/FUgEOKBEhU4e0abL7J7CD24fD9ohiLN5hagG/kWCYj4K5oaxxtj2Z0Dig==", "dev": true, - "license": "MIT", "engines": { "node": ">=18" }, @@ -7213,8 +7201,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/graphql": { "version": "16.9.0", @@ -9715,9 +9702,9 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, "node_modules/msw": { - "version": "2.6.8", - "resolved": "https://registry.npmjs.org/msw/-/msw-2.6.8.tgz", - "integrity": "sha512-nxXxnH6WALZ9a7rsQp4HU2AaD4iGAiouMmE/MY4al7pXTibgA6OZOuKhmN2WBIM6w9qMKwRtX8p2iOb45B2M/Q==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/msw/-/msw-2.7.0.tgz", + "integrity": "sha512-BIodwZ19RWfCbYTxWTUfTXc+sg4OwjCAgxU1ZsgmggX/7S3LdUifsbUPJs61j0rWb19CZRGY5if77duhc0uXzw==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -9730,12 +9717,12 @@ "@open-draft/until": "^2.1.0", "@types/cookie": "^0.6.0", "@types/statuses": "^2.0.4", - "chalk": "^4.1.2", "graphql": "^16.8.1", "headers-polyfill": "^4.0.2", "is-node-process": "^1.2.0", "outvariant": "^1.4.3", "path-to-regexp": "^6.3.0", + "picocolors": "^1.1.1", "strict-event-emitter": "^0.5.1", "type-fest": "^4.26.1", "yargs": "^17.7.2" @@ -9758,49 +9745,12 @@ } } }, - "node_modules/msw/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/msw/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/msw/node_modules/path-to-regexp": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.3.0.tgz", "integrity": "sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ==", "dev": true }, - "node_modules/msw/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/msw/node_modules/type-fest": { "version": "4.26.1", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.26.1.tgz", @@ -13956,7 +13906,6 @@ "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.4.3.tgz", "integrity": "sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw==", "dev": true, - "license": "MIT", "engines": { "node": ">=16" }, @@ -14160,15 +14109,14 @@ } }, "node_modules/typescript-eslint": { - "version": "8.18.0", - "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.18.0.tgz", - "integrity": "sha512-Xq2rRjn6tzVpAyHr3+nmSg1/9k9aIHnJ2iZeOH7cfGOWqTkXTm3kwpQglEuLGdNrYvPF+2gtAs+/KF5rjVo+WQ==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.18.1.tgz", + "integrity": "sha512-Mlaw6yxuaDEPQvb/2Qwu3/TfgeBHy9iTJ3mTwe7OvpPmF6KPQjVOfGyEJpPv6Ez2C34OODChhXrzYw/9phI0MQ==", "dev": true, - "license": "MIT", "dependencies": { - "@typescript-eslint/eslint-plugin": "8.18.0", - "@typescript-eslint/parser": "8.18.0", - "@typescript-eslint/utils": "8.18.0" + "@typescript-eslint/eslint-plugin": "8.18.1", + "@typescript-eslint/parser": "8.18.1", + "@typescript-eslint/utils": "8.18.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -14415,11 +14363,10 @@ } }, "node_modules/vite": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/vite/-/vite-6.0.3.tgz", - "integrity": "sha512-Cmuo5P0ENTN6HxLSo6IHsjCLn/81Vgrp81oaiFFMRa8gGDj5xEjIcEpf2ZymZtZR8oU0P2JX5WuUp/rlXcHkAw==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/vite/-/vite-6.0.4.tgz", + "integrity": "sha512-zwlH6ar+6o6b4Wp+ydhtIKLrGM/LoqZzcdVmkGAFun0KHTzIzjh+h0kungEx7KJg/PYnC80I4TII9WkjciSR6Q==", "dev": true, - "license": "MIT", "dependencies": { "esbuild": "^0.24.0", "postcss": "^8.4.49", diff --git a/package.json b/package.json index 160cd4c88..769da03ec 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "prepare": "husky" }, "dependencies": { - "@amplitude/analytics-browser": "^2.11.9", + "@amplitude/analytics-browser": "^2.11.10", "@elastic/ecs-winston-format": "^1.5.3", "@navikt/oasis": "^3.6.0", "express": "^4.21.2", @@ -68,19 +68,19 @@ "@vitest/ui": "^2.1.4", "axe-core": "^4.10.2", "clsx": "^2.1.1", - "cypress": "^13.16.1", + "cypress": "^13.17.0", "cypress-axe": "^1.4.0", "date-fns": "^4.1.0", "eslint": "^9.17.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-import": "^2.31.0", - "globals": "^15.13.0", + "globals": "^15.14.0", "highcharts": "^11.4.8", "highcharts-react-official": "^3.2.1", "husky": "^9.1.7", "jsdom": "^25.0.1", "lint-staged": "^15.2.11", - "msw": "^2.6.8", + "msw": "^2.7.0", "node-sass": "^9.0.0", "openapi-typescript": "^7.4.4", "postcss": "^8.4.49", @@ -102,8 +102,8 @@ "stylelint-config-standard-scss": "^14.0.0", "timers": "^0.1.1", "typescript": "^5.7.2", - "typescript-eslint": "^8.18.0", - "vite": "^6.0.3", + "typescript-eslint": "^8.18.1", + "vite": "^6.0.4", "vite-plugin-eslint": "^1.8.1", "vite-plugin-sass-dts": "^1.3.29", "vite-plugin-stylelint": "^6.0.0", diff --git a/public/mockServiceWorker.js b/public/mockServiceWorker.js index ebaaf696a..dbc5b1d0c 100644 --- a/public/mockServiceWorker.js +++ b/public/mockServiceWorker.js @@ -1,3 +1,4 @@ +/* eslint-disable */ /* tslint:disable */ /** @@ -144,7 +145,7 @@ async function handleRequest(event, requestId) { headers: Object.fromEntries(responseClone.headers.entries()), }, }, - [responseClone.body] + [responseClone.body], ) })() } @@ -202,7 +203,7 @@ async function getResponse(event, client, requestId) { if (acceptHeader) { const values = acceptHeader.split(',').map((value) => value.trim()) const filteredValues = values.filter( - (value) => value !== 'msw/passthrough' + (value) => value !== 'msw/passthrough', ) if (filteredValues.length > 0) { @@ -251,7 +252,7 @@ async function getResponse(event, client, requestId) { keepalive: request.keepalive, }, }, - [requestBuffer] + [requestBuffer], ) switch (clientMessage.type) { @@ -281,7 +282,7 @@ function sendToClient(client, message, transferrables = []) { client.postMessage( message, - [channel.port2].concat(transferrables.filter(Boolean)) + [channel.port2].concat(transferrables.filter(Boolean)), ) }) } diff --git a/src/components/Grunnlag/__tests__/Grunnlag.test.tsx b/src/components/Grunnlag/__tests__/Grunnlag.test.tsx index 7cb4fc2b9..1bf106497 100644 --- a/src/components/Grunnlag/__tests__/Grunnlag.test.tsx +++ b/src/components/Grunnlag/__tests__/Grunnlag.test.tsx @@ -137,12 +137,22 @@ describe('Grunnlag', () => { describe('Grunnlag - sivilstand', () => { it('viser riktig tekst og lenke når henting av sivilstand er vellykket', async () => { const user = userEvent.setup() - mockResponse('/v2/person', { + mockResponse('/v4/person', { status: 200, json: { navn: 'Ola', sivilstand: 'GIFT', foedselsdato: '1963-04-30', + pensjoneringAldre: { + normertPensjoneringsalder: { + aar: 67, + maaneder: 0, + }, + nedreAldersgrense: { + aar: 62, + maaneder: 0, + }, + }, }, }) renderGrunnlagMedPreloadedState('2', 'avansert', { @@ -173,12 +183,22 @@ describe('Grunnlag', () => { it('viser riktig tekst og lenke når brukeren har oppgitt samboerskap manuelt', async () => { const user = userEvent.setup() - mockResponse('/v2/person', { + mockResponse('/v4/person', { status: 200, json: { navn: 'Ola', sivilstand: 'UGIFT', foedselsdato: '1963-04-30', + pensjoneringAldre: { + normertPensjoneringsalder: { + aar: 67, + maaneder: 0, + }, + nedreAldersgrense: { + aar: 62, + maaneder: 0, + }, + }, }, }) @@ -209,7 +229,7 @@ describe('Grunnlag', () => { it('viser feilmelding når henting av personopplysninger feiler', async () => { const user = userEvent.setup() - mockErrorResponse('/v2/person') + mockErrorResponse('/v4/person') renderGrunnlagMedPreloadedState('2', 'enkel') await waitFor(() => { diff --git a/src/components/RedigerAvansertBeregning/__tests__/__snapshots__/RedigerAvansertBeregning.test.tsx.snap b/src/components/RedigerAvansertBeregning/__tests__/__snapshots__/RedigerAvansertBeregning.test.tsx.snap index 9b7cc67d7..670d37eef 100644 --- a/src/components/RedigerAvansertBeregning/__tests__/__snapshots__/RedigerAvansertBeregning.test.tsx.snap +++ b/src/components/RedigerAvansertBeregning/__tests__/__snapshots__/RedigerAvansertBeregning.test.tsx.snap @@ -353,7 +353,7 @@ exports[`RedigerAvansertBeregning > Gitt at en bruker har vedtak om alderspensjo
( return arr }, []) + const hasError = React.useMemo(() => { + if (error) { + if (!valgtAlder.aar && valgtAlder.maaneder === undefined) { + return { aar: true, maaneder: true } + } + if (valgtAlder.aar && valgtAlder.maaneder !== undefined) { + return { aar: true, maaneder: true } + } + if (valgtAlder.aar && valgtAlder.maaneder === undefined) { + return { aar: false, maaneder: true } + } + if (!valgtAlder.aar && valgtAlder.maaneder !== undefined) { + return { aar: true, maaneder: false } + } + } + return { aar: false, maaneder: false } + }, [error, valgtAlder]) + const transformertDate = React.useMemo(() => { if ( isSuccess && @@ -109,7 +127,7 @@ export const AgePicker = forwardRef( name={`${name}-aar`} label="Velg år" className={clsx(styles.selectAar, { - [styles.select__hasError]: !!error && !valgtAlder.aar, + [styles.select__hasError]: hasError.aar, })} value={valgtAlder.aar ? valgtAlder.aar : ''} onChange={(e: React.ChangeEvent) => { @@ -138,8 +156,8 @@ export const AgePicker = forwardRef( }) } }} - aria-describedby={error ? `${name}-error` : undefined} - aria-invalid={!!error && !valgtAlder.aar} + aria-describedby={hasError.maaneder ? `${name}-error` : undefined} + aria-invalid={hasError.aar} aria-required >