diff --git a/frontend/src/pages/client-details/ContactView.vue b/frontend/src/pages/client-details/ContactView.vue
index 90b782b6e..a99e70bb6 100644
--- a/frontend/src/pages/client-details/ContactView.vue
+++ b/frontend/src/pages/client-details/ContactView.vue
@@ -1,11 +1,17 @@
@@ -35,8 +41,8 @@ defineProps<{
:id="`contact-${index}-primaryPhoneNumber`"
v-if="data.businessPhone"
>
-
- {{ data.businessPhone }}
+
+ {{ businessPhone }}
-
- {{ data.secondaryPhone }}
+
+ {{ secondaryPhone }}
-
- {{ data.faxNumber }}
+
+ {{ faxNumber }}
diff --git a/frontend/src/pages/client-details/LocationView.vue b/frontend/src/pages/client-details/LocationView.vue
index 15a757ce8..643a2448a 100644
--- a/frontend/src/pages/client-details/LocationView.vue
+++ b/frontend/src/pages/client-details/LocationView.vue
@@ -1,12 +1,18 @@
@@ -60,8 +66,8 @@ const indexString = props.data.clientLocnCode;
:id="`location-${indexString}-primaryPhoneNumber`"
v-if="data.businessPhone"
>
-
- {{ data.businessPhone }}
+
+ {{ businessPhone }}
-
- {{ data.cellPhone }}
+
+ {{ cellPhone }}
-
- {{ data.homePhone }}
+
+ {{ homePhone }}
-
- {{ data.faxNumber }}
+
+ {{ faxNumber }}
diff --git a/frontend/src/pages/client-details/SummaryView.vue b/frontend/src/pages/client-details/SummaryView.vue
index 1f4c8b125..0b0be24bf 100644
--- a/frontend/src/pages/client-details/SummaryView.vue
+++ b/frontend/src/pages/client-details/SummaryView.vue
@@ -32,17 +32,25 @@ const doingBusinessAs = computed(() => {
return undefined;
});
-const birthdateLabel = computed(() =>
- props.data.birthdate.length > 4 ? "Date of birth" : "Year of birth",
-);
-
const dateOfBirth = computed(() => {
+ if (props.data.birthdate) {
+ if (props.data.birthdate.length === 4) {
+ return props.data.birthdate;
+ }
+
+ // if masked (month and day)
+ if (props.data.birthdate.includes("*")) {
+ return props.data.birthdate.slice(0, 4);
+ }
- if(props.data.birthdate) {
- return new Date(props.data.birthdate).toISOString().split('T')[0];
+ return new Date(props.data.birthdate).toISOString().split("T")[0];
}
- return '';
+ return "";
});
+
+const birthdateLabel = computed(() =>
+ dateOfBirth.value.length > 4 ? "Date of birth" : "Year of birth",
+);
diff --git a/frontend/src/services/ForestClientService.ts b/frontend/src/services/ForestClientService.ts
index f1e55bff0..211e4b23f 100644
--- a/frontend/src/services/ForestClientService.ts
+++ b/frontend/src/services/ForestClientService.ts
@@ -140,3 +140,15 @@ export const goodStanding = (goodStanding: string): string => {
if (goodStanding) return goodStanding === "Y" ? "Good standing" : "Not in good standing";
return "Unknown";
};
+
+export const formatPhoneNumber = (phoneNumber: string): string => {
+ if (!phoneNumber) {
+ return "";
+ }
+
+ const part1 = phoneNumber.slice(0, 3);
+ const part2 = phoneNumber.slice(3, 6);
+ const part3 = phoneNumber.slice(6);
+
+ return `(${part1}) ${part2}-${part3}`;
+};
diff --git a/frontend/stub/__files/response-clients-details-G.json b/frontend/stub/__files/response-clients-details-G.json
index 1b8b2d0ff..5dd390920 100644
--- a/frontend/stub/__files/response-clients-details-G.json
+++ b/frontend/stub/__files/response-clients-details-G.json
@@ -17,9 +17,9 @@
"contactName": "Cheryl Bibby",
"contactTypeCode": "BL",
"contactTypeDesc": "Billing",
- "businessPhone": "({{randomValue length=3 type='NUMERIC'}}) {{randomValue length=3 type='NUMERIC'}}-{{randomValue length=4 type='NUMERIC'}}",
- "secondaryPhone": "({{randomValue length=3 type='NUMERIC'}}) {{randomValue length=3 type='NUMERIC'}}-{{randomValue length=4 type='NUMERIC'}}",
- "faxNumber": "({{randomValue length=3 type='NUMERIC'}}) {{randomValue length=3 type='NUMERIC'}}-{{randomValue length=4 type='NUMERIC'}}",
+ "businessPhone": "{{randomValue length=10 type='NUMERIC'}}",
+ "secondaryPhone": "{{randomValue length=10 type='NUMERIC'}}",
+ "faxNumber": "{{randomValue length=10 type='NUMERIC'}}",
"emailAddress": "cheryl@ktb.com"
},
{
@@ -27,9 +27,9 @@
"contactName": "Edward Burns",
"contactTypeCode": "DI",
"contactTypeDesc": "Director",
- "businessPhone": "({{randomValue length=3 type='NUMERIC'}}) {{randomValue length=3 type='NUMERIC'}}-{{randomValue length=4 type='NUMERIC'}}",
- "secondaryPhone": "({{randomValue length=3 type='NUMERIC'}}) {{randomValue length=3 type='NUMERIC'}}-{{randomValue length=4 type='NUMERIC'}}",
- "faxNumber": "({{randomValue length=3 type='NUMERIC'}}) {{randomValue length=3 type='NUMERIC'}}-{{randomValue length=4 type='NUMERIC'}}",
+ "businessPhone": "{{randomValue length=10 type='NUMERIC'}}",
+ "secondaryPhone": "{{randomValue length=10 type='NUMERIC'}}",
+ "faxNumber": "{{randomValue length=10 type='NUMERIC'}}",
"emailAddress": "burns@ktb.com"
},
{
@@ -57,10 +57,10 @@
"city":"Hampton",
"postalCode": "{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}",
"emailAddress": "contact@mail.com",
- "businessPhone": "(250) 286-3767",
- "cellPhone": "(250) 555-3700",
- "homePhone": "(250) 555-3101",
- "faxNumber": "(250) 286-3768",
+ "businessPhone": "2502863767",
+ "cellPhone": "2505553700",
+ "homePhone": "2505553101",
+ "faxNumber": "2502863768",
"cliLocnComment": "Sample location 00 comment",
"locnExpiredInd": "N"
},
@@ -77,10 +77,10 @@
"city":"Deer Lake",
"postalCode": "{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}",
"emailAddress": "account@mail.com",
- "businessPhone": "(250) 286-4767",
- "cellPhone": "(250) 555-4700",
- "homePhone": "(250) 555-4101",
- "faxNumber": "(250) 286-4768",
+ "businessPhone": "2502864767",
+ "cellPhone": "2505554700",
+ "homePhone": "2505554101",
+ "faxNumber": "2502864768",
"cliLocnComment": "Sample location 01 comment",
"locnExpiredInd": "N"
},
@@ -97,10 +97,10 @@
"city":"Deer Lake",
"postalCode": "{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}",
"emailAddress": "warehouse@mail.com",
- "businessPhone": "(250) 286-5767",
- "cellPhone": "(250) 555-5700",
- "homePhone": "(250) 555-5101",
- "faxNumber": "(250) 286-5768",
+ "businessPhone": "2502865767",
+ "cellPhone": "2505555700",
+ "homePhone": "2505555101",
+ "faxNumber": "2502865768",
"cliLocnComment": "Sample location 02 comment",
"locnExpiredInd": "N"
}
diff --git a/frontend/stub/__files/response-clients-details-GD.json b/frontend/stub/__files/response-clients-details-GD.json
index f90c9d4c1..a32a2d205 100644
--- a/frontend/stub/__files/response-clients-details-GD.json
+++ b/frontend/stub/__files/response-clients-details-GD.json
@@ -31,7 +31,7 @@
"city":"Hampton",
"postalCode": "{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}",
"emailAddress": "contact@mail.com",
- "businessPhone": "(250) 286-3767",
+ "businessPhone": "2502863767",
"cellPhone": "",
"homePhone": "",
"faxNumber": "",
@@ -51,8 +51,8 @@
"city":"Deer Lake",
"postalCode": "{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}",
"emailAddress": "account@mail.com",
- "businessPhone": "(250) 286-4767",
- "cellPhone": "(250) 555-4700",
+ "businessPhone": "2502864767",
+ "cellPhone": "2505554700",
"homePhone": "",
"faxNumber": "",
"cliLocnComment": "Sample location 01 comment",
diff --git a/frontend/stub/__files/response-clients-details-I.json b/frontend/stub/__files/response-clients-details-I.json
index acc4702ff..df3805c14 100644
--- a/frontend/stub/__files/response-clients-details-I.json
+++ b/frontend/stub/__files/response-clients-details-I.json
@@ -5,7 +5,7 @@
"clientName": "Silver",
"legalFirstName": "John",
"legalMiddleName": "",
- "birthdate": "1952-08-17",
+ "birthdate": "1952-08-17T00:00",
"clientIdTypeCode": "BCDL",
"clientIdTypeDesc": "British Columbia Driver's Licence",
"clientIdentification": "64242646",
@@ -32,7 +32,7 @@
"city":"Hampton",
"postalCode": "{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}",
"emailAddress": "tony.pineda@mail.com",
- "businessPhone": "(250) 286-3767",
+ "businessPhone": "2502863767",
"cellPhone": "",
"homePhone": "",
"faxNumber": "",
diff --git a/frontend/stub/__files/response-clients-details-IV.json b/frontend/stub/__files/response-clients-details-IV.json
index ccfc29072..c0526f0e3 100644
--- a/frontend/stub/__files/response-clients-details-IV.json
+++ b/frontend/stub/__files/response-clients-details-IV.json
@@ -5,7 +5,7 @@
"clientName": "Silver",
"legalFirstName": "John",
"legalMiddleName": "",
- "birthdate": "1952",
+ "birthdate": "1952-**-**",
"clientIdTypeCode": "BCDL",
"clientIdTypeDesc": "British Columbia Driver's Licence",
"clientIdentification": "6****646",
@@ -32,7 +32,7 @@
"city":"Hampton",
"postalCode": "{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}",
"emailAddress": "tony.pineda@mail.com",
- "businessPhone": "(250) 286-3767",
+ "businessPhone": "2502863767",
"cellPhone": "",
"homePhone": "",
"faxNumber": "",
diff --git a/frontend/stub/__files/response-clients-details-NL.json b/frontend/stub/__files/response-clients-details-NL.json
index 9234b4ad1..669d47a6b 100644
--- a/frontend/stub/__files/response-clients-details-NL.json
+++ b/frontend/stub/__files/response-clients-details-NL.json
@@ -6,7 +6,7 @@
"legalFirstName": "Michael",
"legalMiddleName": "",
"doingBusinessAs": [],
- "birthdate": "1962-08-17",
+ "birthdate": "1962-08-17T00:00",
"clientAcronym": "",
"clientTypeCode": "RSP",
"clientTypeDesc": "Registered sole proprietorship",
diff --git a/frontend/stub/__files/response-clients-details-S.json b/frontend/stub/__files/response-clients-details-S.json
index aea358d13..7bc737a14 100644
--- a/frontend/stub/__files/response-clients-details-S.json
+++ b/frontend/stub/__files/response-clients-details-S.json
@@ -8,7 +8,7 @@
"doingBusinessAs": [
{"doingBusinessAsName": "Dunder Mifflin Paper Company"}
],
- "birthdate": "1962-08-17",
+ "birthdate": "1962-08-17T00:00",
"clientAcronym": "DMPC",
"clientTypeCode": "RSP",
"clientTypeDesc": "Registered sole proprietorship",
@@ -22,7 +22,7 @@
"contactName": "Cheryl Bibby",
"contactTypeCode": "BL",
"contactTypeDesc": "Billing",
- "businessPhone": "({{randomValue length=3 type='NUMERIC'}}) {{randomValue length=3 type='NUMERIC'}}-{{randomValue length=4 type='NUMERIC'}}",
+ "businessPhone": "{{randomValue length=10 type='NUMERIC'}}",
"secondaryPhone": "",
"faxNumber": "",
"emailAddress": ""
@@ -41,10 +41,10 @@
"city":"Hampton",
"postalCode": "{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}",
"emailAddress": "contact@mail.com",
- "businessPhone": "(250) 286-3767",
- "cellPhone": "(250) 555-3700",
- "homePhone": "(250) 555-3101",
- "faxNumber": "(250) 286-3768",
+ "businessPhone": "2502863767",
+ "cellPhone": "2505553700",
+ "homePhone": "2505553101",
+ "faxNumber": "2502863768",
"cliLocnComment": "Sample location 00 comment",
"locnExpiredInd": "N"
},
@@ -61,10 +61,10 @@
"city":"Deer Lake",
"postalCode": "{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}",
"emailAddress": "account@mail.com",
- "businessPhone": "(250) 286-4767",
- "cellPhone": "(250) 555-4700",
- "homePhone": "(250) 555-4101",
- "faxNumber": "(250) 286-4768",
+ "businessPhone": "2502864767",
+ "cellPhone": "2505554700",
+ "homePhone": "2505554101",
+ "faxNumber": "2502864768",
"cliLocnComment": "Sample location 01 comment",
"locnExpiredInd": "N"
}
diff --git a/frontend/stub/__files/response-clients-details-SE.json b/frontend/stub/__files/response-clients-details-SE.json
index 1ebbde5fc..8624e79ac 100644
--- a/frontend/stub/__files/response-clients-details-SE.json
+++ b/frontend/stub/__files/response-clients-details-SE.json
@@ -20,7 +20,7 @@
"contactName": "Cheryl Bibby",
"contactTypeCode": "BL",
"contactTypeDesc": "Billing",
- "businessPhone": "({{randomValue length=3 type='NUMERIC'}}) {{randomValue length=3 type='NUMERIC'}}-{{randomValue length=4 type='NUMERIC'}}",
+ "businessPhone": "{{randomValue length=10 type='NUMERIC'}}",
"secondaryPhone": "",
"faxNumber": "",
"emailAddress": ""
@@ -39,10 +39,10 @@
"city":"Hampton",
"postalCode": "{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}",
"emailAddress": "contact@mail.com",
- "businessPhone": "(250) 286-3767",
- "cellPhone": "(250) 555-3700",
- "homePhone": "(250) 555-3101",
- "faxNumber": "(250) 286-3768",
+ "businessPhone": "2502863767",
+ "cellPhone": "2505553700",
+ "homePhone": "2505553101",
+ "faxNumber": "2502863768",
"cliLocnComment": "Sample location 00 comment",
"locnExpiredInd": "N"
},
@@ -59,10 +59,10 @@
"city":"Deer Lake",
"postalCode": "{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}",
"emailAddress": "account@mail.com",
- "businessPhone": "(250) 286-4767",
- "cellPhone": "(250) 555-4700",
- "homePhone": "(250) 555-4101",
- "faxNumber": "(250) 286-4768",
+ "businessPhone": "2502864767",
+ "cellPhone": "2505554700",
+ "homePhone": "2505554101",
+ "faxNumber": "2502864768",
"cliLocnComment": "Sample location 01 comment",
"locnExpiredInd": "N"
}
diff --git a/frontend/tests/components/pages/client-details/ContactView.cy.ts b/frontend/tests/components/pages/client-details/ContactView.cy.ts
index 10605eda9..23af87601 100644
--- a/frontend/tests/components/pages/client-details/ContactView.cy.ts
+++ b/frontend/tests/components/pages/client-details/ContactView.cy.ts
@@ -1,5 +1,6 @@
import type { ClientContact } from "@/dto/CommonTypesDto";
import ContactView from "@/pages/client-details/ContactView.vue";
+import { formatPhoneNumber } from "@/services/ForestClientService";
describe("", () => {
const getDefaultProps = () => ({
@@ -8,9 +9,9 @@ describe("", () => {
contactName: "Cheryl Bibby",
contactTypeCode: "BL",
contactTypeDesc: "Billing",
- businessPhone: "(250) 286-3767",
- secondaryPhone: "(250) 555-3700",
- faxNumber: "(250) 286-3768",
+ businessPhone: "2502863767",
+ secondaryPhone: "2505553700",
+ faxNumber: "2502863768",
emailAddress: "cheryl@ktb.com",
} as ClientContact,
index: 0,
@@ -58,9 +59,17 @@ describe("", () => {
const phonePrefix = "tel:";
cy.get("#contact-0-phone-section").within(() => {
- testField("#contact-0-primaryPhoneNumber", currentProps.data.businessPhone, phonePrefix);
- testField("#contact-0-secondaryPhoneNumber", currentProps.data.secondaryPhone, phonePrefix);
- testField("#contact-0-fax", currentProps.data.faxNumber, phonePrefix);
+ testField(
+ "#contact-0-primaryPhoneNumber",
+ formatPhoneNumber(currentProps.data.businessPhone),
+ phonePrefix,
+ );
+ testField(
+ "#contact-0-secondaryPhoneNumber",
+ formatPhoneNumber(currentProps.data.secondaryPhone),
+ phonePrefix,
+ );
+ testField("#contact-0-fax", formatPhoneNumber(currentProps.data.faxNumber), phonePrefix);
});
});
@@ -108,7 +117,7 @@ describe("", () => {
businessPhone: "",
secondaryPhone: "",
faxNumber: "",
- [propName]: "(250) 555-9876",
+ [propName]: "2505559876",
};
mount({
...getDefaultProps(),
@@ -117,7 +126,7 @@ describe("", () => {
});
it(`displays the one phone with value: ${propName}`, () => {
cy.get("#contact-0-phone-section").within(() => {
- testField(selector, currentProps.data[propName]);
+ testField(selector, formatPhoneNumber(currentProps.data[propName]));
});
});
it("hides the other empty phones", () => {
diff --git a/frontend/tests/components/pages/client-details/LocationView.cy.ts b/frontend/tests/components/pages/client-details/LocationView.cy.ts
index b69e2ef9f..8d213b931 100644
--- a/frontend/tests/components/pages/client-details/LocationView.cy.ts
+++ b/frontend/tests/components/pages/client-details/LocationView.cy.ts
@@ -1,5 +1,6 @@
import type { ClientLocation } from "@/dto/CommonTypesDto";
import LocationView from "@/pages/client-details/LocationView.vue";
+import { formatPhoneNumber } from "@/services/ForestClientService";
describe("", () => {
const getDefaultProps = () => ({
@@ -16,10 +17,10 @@ describe("", () => {
city: "Hampton",
postalCode: "T4G5J1",
emailAddress: "contact@mail.com",
- businessPhone: "(250) 286-3767",
- cellPhone: "(250) 555-3700",
- homePhone: "(250) 555-3101",
- faxNumber: "(250) 286-3768",
+ businessPhone: "2502863767",
+ cellPhone: "2505553700",
+ homePhone: "2505553101",
+ faxNumber: "2502863768",
cliLocnComment: "Sample location 00 comment",
locnExpiredInd: "N",
} as ClientLocation,
@@ -79,10 +80,22 @@ describe("", () => {
const phonePrefix = "tel:";
cy.get("#location-00-phone-section").within(() => {
- testField("#location-00-primaryPhoneNumber", currentProps.data.businessPhone, phonePrefix);
- testField("#location-00-secondaryPhoneNumber", currentProps.data.cellPhone, phonePrefix);
- testField("#location-00-tertiaryPhoneNumber", currentProps.data.homePhone, phonePrefix);
- testField("#location-00-fax", currentProps.data.faxNumber, phonePrefix);
+ testField(
+ "#location-00-primaryPhoneNumber",
+ formatPhoneNumber(currentProps.data.businessPhone),
+ phonePrefix,
+ );
+ testField(
+ "#location-00-secondaryPhoneNumber",
+ formatPhoneNumber(currentProps.data.cellPhone),
+ phonePrefix,
+ );
+ testField(
+ "#location-00-tertiaryPhoneNumber",
+ formatPhoneNumber(currentProps.data.homePhone),
+ phonePrefix,
+ );
+ testField("#location-00-fax", formatPhoneNumber(currentProps.data.faxNumber), phonePrefix);
});
cy.get("#location-00-notes-section").within(() => {
@@ -140,13 +153,13 @@ describe("", () => {
cellPhone: "",
homePhone: "",
faxNumber: "",
- [propName]: "(250) 555-9876",
+ [propName]: "2505559876",
};
mount({ data });
});
it(`displays the one phone with value: ${propName}`, () => {
cy.get("#location-00-phone-section").within(() => {
- testField(selector, currentProps.data[propName]);
+ testField(selector, formatPhoneNumber(currentProps.data[propName]));
});
});
it("hides the other empty phones", () => {
diff --git a/frontend/tests/components/pages/client-details/SummaryView.cy.ts b/frontend/tests/components/pages/client-details/SummaryView.cy.ts
index 0a7696e1e..c7f817290 100644
--- a/frontend/tests/components/pages/client-details/SummaryView.cy.ts
+++ b/frontend/tests/components/pages/client-details/SummaryView.cy.ts
@@ -115,6 +115,15 @@ describe("", () => {
cy.get("#dateOfBirth").contains("Date of birth");
});
+ it("sets the birthdate label to 'Year of birth' when date's month and day are masked", () => {
+ const { data } = getDefaultProps();
+ data.birthdate = "1985-**-**";
+
+ mount({ data });
+
+ cy.get("#dateOfBirth").contains("Year of birth");
+ });
+
it("sets the birthdate label to 'Year of birth' when date has only four digits", () => {
const { data } = getDefaultProps();
data.birthdate = "1985";