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

8418 r50c masked name also hides other attributes #163

Merged
merged 2 commits into from
Dec 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Expand Up @@ -101,28 +101,23 @@ private void buildPersonDetails(GetDemographicsResponse demographicsResponse,
GetPersonDetailsResponse personDetailsResponse) {
Person person = demographicsResponse.getPerson();
// "Documented" should always be shown over a "Declared" name.
Name name = person.getDocumentedName();
if (name == null) {
name = person.getDeclaredName();
}

Name name = person.getDocumentedName() != null ? person.getDocumentedName() : person.getDeclaredName();
if (name != null) {
personDetailsResponse.setPhn(person.getPhn());
personDetailsResponse.setGivenName(name.getFirstGivenName());
personDetailsResponse.setSecondName(name.getSecondGivenName());
personDetailsResponse.setSurname(name.getSurname());
}

if (person.getBirthDate() != null) {
String birthDate = V3MessageUtil.convertDateToString(person.getBirthDate());
personDetailsResponse.setDateOfBirth(birthDate);
}

String deathDate = person.getDeathDate() != null ? V3MessageUtil.convertDateToString(person.getDeathDate()) :"N/A";
personDetailsResponse.setDateOfDeath(deathDate);

personDetailsResponse.setGender(person.getGender());
if (person.getBirthDate() != null) {
String birthDate = V3MessageUtil.convertDateToString(person.getBirthDate());
personDetailsResponse.setDateOfBirth(birthDate);
}


personDetailsResponse.setPhn(person.getPhn());
String deathDate = person.getDeathDate() != null ? V3MessageUtil.convertDateToString(person.getDeathDate()): "N/A";
personDetailsResponse.setDateOfDeath(deathDate);
personDetailsResponse.setGender(person.getGender());

Address physicalAddress = demographicsResponse.getPerson().getPhysicalAddress();
if (physicalAddress != null) {
personDetailsResponse.setAddress1(physicalAddress.getAddressLine1());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import dayjs from 'dayjs'

import { OUTPUT_DATE_FORMAT } from '../../../../src/util/constants'
import { SITE_UNDER_TEST } from '../../configuration'
import AlertPage from '../../pages/AlertPage'
import AddVisaResidentWithPHNPage from '../../pages/enrollment/AddVisaResidentWithPHNPage'
import AlertPage from '../../pages/AlertPage'
import { OUTPUT_DATE_FORMAT } from '../../../../src/util/constants'
import PersonDetails from '../../pages/enrollment/PersonDetailsPage'
import { SITE_UNDER_TEST } from '../../configuration'
import dayjs from 'dayjs'
import { regularAccUser } from '../../roles/roles'

const immigrationCodeOption = AddVisaResidentWithPHNPage.immigrationCodeSelect.find('option')
Expand Down Expand Up @@ -87,6 +86,9 @@ test('Check required fields validation for mailing address', async (t) => {
.click(PersonDetails.submitButton)
.wait(5000)
// Given required fields aren't filled out
// Mailing Address 1 may alreay have value
.selectText(AddVisaResidentWithPHNPage.mailingAddress1Input)
.pressKey('delete')
.typeText(AddVisaResidentWithPHNPage.mailingAddress2Input, 'Test 111 ST')
// When I click the submit button
.click(AddVisaResidentWithPHNPage.submitButton)
Expand Down Expand Up @@ -170,7 +172,7 @@ test('Check invalid input field character validation', async (t) => {
.click(AddVisaResidentWithPHNPage.provinceSelect)
.click(provinceOption.withText('British Columbia'))
.typeText(AddVisaResidentWithPHNPage.postalCodeInput, '[][][]')
.typeText(AddVisaResidentWithPHNPage.mailingAddress1Input, 'Test 111 +_)(*&')
.typeText(AddVisaResidentWithPHNPage.mailingAddress1Input, 'Test 111 +_)(*&', { replace: true })
.typeText(AddVisaResidentWithPHNPage.mailingAddress2Input, 'Test 111 ST @@@@@')
.typeText(AddVisaResidentWithPHNPage.mailingAddress3Input, '!@#$%^*(9')
.typeText(AddVisaResidentWithPHNPage.mailingCityInput, 'VICTORIA<>')
Expand Down