Skip to content

Commit

Permalink
Playwright-tester
Browse files Browse the repository at this point in the history
  • Loading branch information
betsytraran committed Sep 25, 2024
1 parent 9f95315 commit b61f6d7
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 2 deletions.
3 changes: 3 additions & 0 deletions apps/dolly-frontend/src/main/js/playwright/globalSetup.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { test as base } from '@playwright/test'
import {
aaregMock,
afpOffentligMock,
ameldingMock,
arenaMock,
backendBestillingerMock,
Expand Down Expand Up @@ -86,6 +87,7 @@ const pensjonTp = new RegExp(/testnav-pensjon-testdata-facade-proxy\/api\/v1\/tp
const pensjonPensjonsavtale = new RegExp(
/testnav-pensjon-testdata-facade-proxy\/api\/v2\/pensjonsavtale\/hent/,
)
const afpOffentlig = new RegExp(/testnav-pensjon-testdata-facade-proxy\/q1\/api\/mock-oppsett/)
const krrstub = new RegExp(/testnav-krrstub-proxy\/api\/v2/)
const udistub = new RegExp(/testnav-udistub-proxy\/api\/v1/)
const brregstub = new RegExp(/testnav-brregstub/)
Expand Down Expand Up @@ -147,6 +149,7 @@ const mockRoutes: RouteInfo[] = [
{ url: pensjon, response: pensjonMock },
{ url: pensjonTp, response: pensjonTpMock },
{ url: pensjonPensjonsavtale, response: pensjonPensjonsavtaleMock },
{ url: afpOffentlig, response: afpOffentligMock },
{ url: sigrunstub, response: sigrunstubMock },
{ url: udistub, response: udistubMock },
{ url: kodeverk, response: kodeverkMock },
Expand Down
50 changes: 50 additions & 0 deletions apps/dolly-frontend/src/main/js/playwright/mocks/BasicMocks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,24 @@ export const pensjonTpMock = [{ ordning: '4095' }, { ordning: '3010' }]

export const pensjonPensjonsavtaleMock = [{}, {}]

export const afpOffentligMock = {
direktekall: [],
mocksvar: [
{
tpId: '4099',
statusAfp: 'INNVILGET',
virkningsDato: '2024-09-01T00:00:00',
sistBenyttetG: 2024,
belopsListe: [
{
fomDato: '2024-09-02T00:00:00',
belop: '10000',
},
],
},
],
}

export const tagsMock = [{ tag: 'DUMMY', beskrivelse: 'Dummy' }]

export const kontoregisterMock = {
Expand Down Expand Up @@ -1486,6 +1504,21 @@ export const backendBestillingerMock = [
},
],
},
{
id: 'PEN_AFP_OFFENTLIG',
navn: 'AFP offentlig (PEN)',
statuser: [
{
melding: 'OK',
detaljert: [
{
miljo: 'q1',
identer: ['12345678912'],
},
],
},
],
},
{
id: 'INNTKMELD',
navn: 'Inntektsmelding (ALTINN/JOARK)',
Expand Down Expand Up @@ -1683,6 +1716,23 @@ export const backendBestillingerMock = [
],
},
],
afpOffentlig: {
direktekall: [],
mocksvar: [
{
tpId: '4099',
statusAfp: 'INNVILGET',
virkningsDato: '2024-09-01T00:00:00',
sistBenyttetG: 2024,
belopsListe: [
{
fomDato: '2024-09-02T00:00:00',
belop: '10000',
},
],
},
],
},
},
inntektsmelding: {
inntekter: [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { runningE2ETest } from '@/service/services/Request'

export const initialBeloep = {
fomDato: null,
fomDato: runningE2ETest() ? new Date() : null,
belop: 0,
}

export const initialMocksvar = {
tpId: null,
statusAfp: null,
virkningsDato: null,
sistBenyttetG: 2024,
sistBenyttetG: new Date().getFullYear(),
belopsListe: [initialBeloep],
}

Expand Down

0 comments on commit b61f6d7

Please sign in to comment.