Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(social-insurance-administration): Add e2e tests #16397

Merged
merged 21 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
a038d6f
[TS-106] e2e tests (Old-age-pension)
veronikasif Oct 15, 2024
5bfdcfd
[TS-319] e2e tests (Additional-support-for-the-elderly)
veronikasif Oct 15, 2024
a8137ca
Fixed typo in nationalRegistry.mock file after coderabbit review
veronikasif Oct 15, 2024
8e1bec7
[TS-156] e2e tests (Pension-supplement)
veronikasif Oct 15, 2024
f15ef35
chore: nx format:write update dirty files
andes-it Oct 15, 2024
bc36986
[TS-155] e2e tests (Household-supplement)
veronikasif Oct 15, 2024
48b9239
Merge branch 'feat/social-insurance-administration-e2e' of https://gi…
veronikasif Oct 15, 2024
6e527fe
[TS-324] e2e test for 1/2 old age pension
veronikasif Oct 15, 2024
f5defe6
Added a helper function that mocks each type of SIA application - cod…
veronikasif Oct 15, 2024
6665d45
Moved all common steps to a shared file so it can be used in multiple…
veronikasif Oct 15, 2024
c23a72c
Updated all instances of faedingardagur in parentalLeave mocks to use…
veronikasif Oct 16, 2024
4ad882c
Added more descriptive test names - coderabbit
veronikasif Oct 16, 2024
115d5d8
Changed getByRole to getByText in submitApplication - coderabbit
veronikasif Oct 16, 2024
e1e6f75
Updated OAP tests - coderabbit
veronikasif Oct 16, 2024
e6329ee
Updated all instances of faedingardagur in nationalRegistry mocks to …
veronikasif Oct 16, 2024
097fa34
[TS-926] Only display available months in TR applications
veronikasif Oct 16, 2024
731b200
Removed TODO comment
veronikasif Oct 17, 2024
bbbd126
Refactor repeated heading visibility checks - coderabbit
veronikasif Oct 17, 2024
51603d7
Merge branch 'main' into feat/social-insurance-administration-e2e
veronikasif Oct 17, 2024
b80c8d5
Merge branch 'main' into feat/social-insurance-administration-e2e
veronikasif Oct 18, 2024
4aceb5d
Merge branch 'main' into feat/social-insurance-administration-e2e
kodiakhq[bot] Oct 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
import { Response } from '@anev/ts-mountebank'
import { NationalRegistry } from '../../../../../../../../infra/src/dsl/xroad'
import { addXroadMock } from '../../../../../support/wire-mocks'
veronikasif marked this conversation as resolved.
Show resolved Hide resolved
veronikasif marked this conversation as resolved.
Show resolved Hide resolved

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',
},
]),
})
await addXroadMock({
config: NationalRegistry,
prefix: 'XROAD_NATIONAL_REGISTRY_SERVICE_PATH',
apiPath: '/api/v1/einstaklingar/0101303019/samibuar',
prefixType: 'only-base-path',
response: new Response().withJSONBody(['0101303019']),
})

/* 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',
}),
})
veronikasif marked this conversation as resolved.
Show resolved Hide resolved
}
veronikasif marked this conversation as resolved.
Show resolved Hide resolved
veronikasif marked this conversation as resolved.
Show resolved Hide resolved
Loading