diff --git a/e2e/helpers.ts b/e2e/helpers.ts index 737d54059..c283ff4c0 100644 --- a/e2e/helpers.ts +++ b/e2e/helpers.ts @@ -292,6 +292,10 @@ export const formatName = (name: PersonOrName) => { return joinValuesWith([name.familyName, name.firstNames]) } +export const formatNameWithFirstNameFirst = (name: PersonOrName) => { + return joinValuesWith([name.firstNames, name.familyName]) +} + export const drawSignature = async (page: Page) => { const canvas = page.locator('#informantSignature_modal canvas') const rect = await canvas.boundingBox() diff --git a/e2e/testcases/correction-birth/correct-birth-record-1.spec.ts b/e2e/testcases/correction-birth/correct-birth-record-1.spec.ts index e3c2be7a7..b7e1b67cb 100644 --- a/e2e/testcases/correction-birth/correct-birth-record-1.spec.ts +++ b/e2e/testcases/correction-birth/correct-birth-record-1.spec.ts @@ -6,6 +6,7 @@ import { formatDateTo_ddMMMMyyyy, formatDateTo_yyyyMMdd, formatName, + formatNameWithFirstNameFirst, getAction, getLocationNameFromFhirId, getToken, @@ -712,8 +713,8 @@ test.describe('1. Correct record - 1', () => { await expect( page.getByText( 'Full name (Child)' + - formatName(declaration.child.name[0]) + - formatName(updatedChildDetails) + formatNameWithFirstNameFirst(declaration.child.name[0]) + + formatNameWithFirstNameFirst(updatedChildDetails) ) ).toBeVisible()