Skip to content

Commit

Permalink
feat(kesaseteli): update year 2024's target groups' ages in frontend
Browse files Browse the repository at this point in the history
refs YJDH-670
  • Loading branch information
karisal-anders committed Jan 26, 2024
1 parent cef39d5 commit 6465b86
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
3 changes: 1 addition & 2 deletions frontend/kesaseteli/handler/src/__tests__/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,7 @@ describe('frontend/kesaseteli/handler/src/pages/index.tsx', () => {
});
const indexPageApi = await getIndexPageApi(application);
await indexPageApi.expectations.pageIsLoaded();
// eslint-disable-next-line unicorn/prefer-ternary
if ([16, 17].includes(age)) {
if (age === 16) {
indexPageApi.expectations.vtjErrorMessageIsNotPresent(
'notInTargetAgeGroup',
{ age }
Expand Down
2 changes: 1 addition & 1 deletion frontend/kesaseteli/handler/src/utils/map-vtj-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export const mapVtjData = (application: ActivatedYouthApplication): VtjInfo => {
vtjData.Henkilo.Henkilotunnus['#text']
);
const age = new Date().getFullYear() - dateOfBirth.getFullYear();
const notInTargetAgeGroup = ![16, 17].includes(age);
const notInTargetAgeGroup = age !== 16;

const isDead = vtjData.Henkilo.Kuolintiedot.Kuollut === '1';
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,7 @@ export const fakeUpperSecondaryEducation1stYearStudentSSN = (): string =>
fakeSSN(upperSecondaryEducation1stYearStudentYear);

export const fakeYouthTargetGroupAgeSSN = (): string =>
fakeSSN(
faker.datatype.number({
min: upperSecondaryEducation1stYearStudentYear,
max: ninethGraderYear,
})
);
fakeSSN(ninethGraderYear);

type TargetGroupData = {
social_security_number: string;
Expand Down

0 comments on commit 6465b86

Please sign in to comment.