-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TS-106] e2e tests (Old-age-pension)
- Loading branch information
1 parent
5ce0312
commit a038d6f
Showing
7 changed files
with
793 additions
and
280 deletions.
There are no files selected for viewing
162 changes: 162 additions & 0 deletions
162
...stem-e2e/src/tests/islandis/application-system/acceptance/mocks/nationalRegistry.mocks.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
import { Response } from '@anev/ts-mountebank' | ||
import { NationalRegistry } from '../../../../../../../../infra/src/dsl/xroad' | ||
import { addXroadMock } from '../../../../../support/wire-mocks' | ||
|
||
export const loadNationalRegistryXroadMocks = async () => { | ||
/* Gervimaður Afríka */ | ||
await addXroadMock({ | ||
config: NationalRegistry, | ||
prefix: 'XROAD_NATIONAL_REGISTRY_SERVICE_PATH', | ||
apiPath: '/api/v1/einstaklingar/0101303019', | ||
prefixType: 'only-base-path', | ||
response: new Response().withJSONBody({ | ||
kennitala: '0101303019', | ||
nafn: 'Gervimaður Afríka', | ||
eiginnafn: 'Gervimaður', | ||
millinafn: null, | ||
kenninafn: 'Afríka', | ||
fulltNafn: 'Gervimaður Afríka', | ||
kynkodi: '1', | ||
bannmerking: false, | ||
faedingardagur: new Date('1930-01-01T00:00:00'), | ||
logheimili: { | ||
heiti: 'Engihjalli 3', | ||
postnumer: '200', | ||
stadur: 'Kópavogur', | ||
sveitarfelagsnumer: '1000', | ||
}, | ||
adsetur: { | ||
heiti: 'Fellsmúli 2', | ||
postnumer: '108', | ||
stadur: 'Reykjavík', | ||
sveitarfelagsnumer: '0000', | ||
}, | ||
}), | ||
}) | ||
await addXroadMock({ | ||
config: NationalRegistry, | ||
prefix: 'XROAD_NATIONAL_REGISTRY_SERVICE_PATH', | ||
apiPath: '/api/v1/einstaklingar/0101303019/hjuskapur', | ||
prefixType: 'only-base-path', | ||
response: new Response().withJSONBody({ | ||
kennitalaMaka: '0101307789', | ||
nafnMaka: 'Gervimaður útlönd', | ||
hjuskaparkodi: '1', | ||
breytt: '2021-05-26T22:23:40.513', | ||
}), | ||
}) | ||
await addXroadMock({ | ||
config: NationalRegistry, | ||
prefix: 'XROAD_NATIONAL_REGISTRY_SERVICE_PATH', | ||
apiPath: '/api/v1/einstaklingar/0101303019/rikisfang', | ||
prefixType: 'only-base-path', | ||
response: new Response().withJSONBody({ | ||
kodi: 'IS', | ||
land: 'Ísland', | ||
}), | ||
}) | ||
await addXroadMock({ | ||
config: NationalRegistry, | ||
prefix: 'XROAD_NATIONAL_REGISTRY_SERVICE_PATH', | ||
apiPath: '/api/v1/einstaklingar/0101303019/buseta', | ||
prefixType: 'only-base-path', | ||
response: new Response().withJSONBody([ | ||
{ | ||
huskodi: '000031440040', | ||
fasteignanumer: '', | ||
heimilisfang: 'Gullengi 4', | ||
postnumer: '112', | ||
stadur: 'Reykjavík', | ||
sveitarfelagsnumer: '0000', | ||
landakodi: 'IS', | ||
breytt: '2022-07-04T00:00:00', | ||
}, | ||
{ | ||
huskodi: '99XT00000000', | ||
fasteignanumer: '', | ||
heimilisfang: 'Afríka ótilgreint', | ||
postnumer: null, | ||
stadur: 'Afríka ótilgreint', | ||
sveitarfelagsnumer: null, | ||
landakodi: 'XT', | ||
breytt: '1992-11-16T00:00:00', | ||
}, | ||
]), | ||
}) | ||
|
||
/* Gervimaður útlönd */ | ||
await addXroadMock({ | ||
config: NationalRegistry, | ||
prefix: 'XROAD_NATIONAL_REGISTRY_SERVICE_PATH', | ||
apiPath: '/api/v1/einstaklingar/0101307789', | ||
prefixType: 'only-base-path', | ||
response: new Response().withJSONBody({ | ||
kennitala: '0101307789', | ||
nafn: 'Gervimaður útlönd', | ||
eiginnafn: 'Gervimaður', | ||
millinafn: null, | ||
kenninafn: 'útlönd', | ||
fulltNafn: 'Gervimaður útlönd', | ||
kynkodi: '1', | ||
bannmerking: false, | ||
faedingardagur: new Date('1930-01-01T00:00:00'), | ||
logheimili: { | ||
heiti: 'Engihjalli 3', | ||
postnumer: '200', | ||
stadur: 'Kópavogur', | ||
sveitarfelagsnumer: '1000', | ||
}, | ||
adsetur: { | ||
heiti: 'Fellsmúli 2', | ||
postnumer: '108', | ||
stadur: 'Reykjavík', | ||
sveitarfelagsnumer: '0000', | ||
}, | ||
}), | ||
}) | ||
await addXroadMock({ | ||
config: NationalRegistry, | ||
prefix: 'XROAD_NATIONAL_REGISTRY_SERVICE_PATH', | ||
apiPath: '/api/v1/einstaklingar/0101307789/hjuskapur', | ||
prefixType: 'only-base-path', | ||
response: new Response().withJSONBody({ | ||
kennitalaMaka: '0101303019', | ||
nafnMaka: 'Gervimaður Afríka', | ||
hjuskaparkodi: '1', | ||
breytt: '2021-05-26T22:23:40.513', | ||
}), | ||
}) | ||
await addXroadMock({ | ||
config: NationalRegistry, | ||
prefix: 'XROAD_NATIONAL_REGISTRY_SERVICE_PATH', | ||
apiPath: '/api/v1/einstaklingar/0101307789/rikisfang', | ||
prefixType: 'only-base-path', | ||
response: new Response().withJSONBody({ | ||
kodi: 'IS', | ||
land: 'Ísland', | ||
}), | ||
}) | ||
await addXroadMock({ | ||
config: NationalRegistry, | ||
prefix: 'XROAD_NATIONAL_REGISTRY_SERVICE_PATH', | ||
apiPath: '/api/v1/einstaklingar/0101307789/faedingarstadur', | ||
prefixType: 'only-base-path', | ||
response: new Response().withJSONBody({ | ||
sveitarfelagsnumer: '0000', | ||
stadur: 'Reykjavík', | ||
faedingardagur: '1930-01-01T00:00:00', | ||
}), | ||
}) | ||
|
||
/* Lyklar */ | ||
await addXroadMock({ | ||
config: NationalRegistry, | ||
prefix: 'XROAD_NATIONAL_REGISTRY_SERVICE_PATH', | ||
apiPath: '/api/v1/lyklar/hjuskaparkodar/1/1', | ||
prefixType: 'only-base-path', | ||
response: new Response().withJSONBody({ | ||
kodi: '1', | ||
lysing: 'Ógiftur', | ||
}), | ||
}) | ||
} |
Oops, something went wrong.