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..64fb808d5 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() @@ -768,7 +769,9 @@ test.describe('1. Correct record - 1', () => { ).toBeVisible() await expect( - page.getByText(formatName(declaration.mother.name[0])) + page.getByText( + formatNameWithFirstNameFirst(declaration.mother.name[0]) + ) ).toBeVisible() await expect(page.getByText('Verified')).toBeVisible() await expect( @@ -802,7 +805,9 @@ test.describe('1. Correct record - 1', () => { await page.getByRole('button', { name: 'Sent for approval' }).click() await expect( - page.getByText(formatName(declaration.child.name[0])).first() + page + .getByText(formatNameWithFirstNameFirst(declaration.child.name[0])) + .first() ).toBeVisible() }) }) @@ -847,7 +852,8 @@ test.describe('1. Correct record - 1', () => { await expect( page.getByText( - 'Requested by' + formatName(declaration.mother.name[0]) + 'Requested by' + + formatNameWithFirstNameFirst(declaration.mother.name[0]) ) ).toBeVisible() @@ -866,8 +872,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() @@ -936,12 +942,14 @@ test.describe('1. Correct record - 1', () => { await expectOutboxToBeEmpty(page) await page.getByRole('button', { name: 'Ready to print' }).click() await expect( - page.getByText(formatName(updatedChildDetails)) + page.getByText(formatNameWithFirstNameFirst(updatedChildDetails)) ).toBeVisible() }) test.describe('1.2.6.4 Validate history in record audit', async () => { test('1.2.6.4.1 Validate entries in record audit', async () => { - await page.getByText(formatName(updatedChildDetails)).click() + await page + .getByText(formatNameWithFirstNameFirst(updatedChildDetails)) + .click() await assignRecord(page) diff --git a/e2e/testcases/correction-birth/correct-birth-record-2.spec.ts b/e2e/testcases/correction-birth/correct-birth-record-2.spec.ts index 55c174979..82299f7c4 100644 --- a/e2e/testcases/correction-birth/correct-birth-record-2.spec.ts +++ b/e2e/testcases/correction-birth/correct-birth-record-2.spec.ts @@ -7,6 +7,7 @@ import { formatDateTo_ddMMMMyyyy, formatDateTo_yyyyMMdd, formatName, + formatNameWithFirstNameFirst, getAction, getToken, goBackToReview, @@ -806,8 +807,8 @@ test.describe.serial('Correct record - 2', () => { await expect( page.getByText( 'Full name (informant)' + - formatName(declaration.informant.name[0]) + - formatName(updatedInformantDetails) + formatNameWithFirstNameFirst(declaration.informant.name[0]) + + formatNameWithFirstNameFirst(updatedInformantDetails) ) ).toBeVisible() @@ -868,7 +869,7 @@ test.describe.serial('Correct record - 2', () => { ).toBeVisible() await expect( - page.getByText(formatName(declaration.father.name[0])) + page.getByText(formatNameWithFirstNameFirst(declaration.father.name[0])) ).toBeVisible() await expect(page.getByText('Identity does not match')).toBeVisible() await expect( @@ -896,7 +897,9 @@ test.describe.serial('Correct record - 2', () => { await page.getByRole('button', { name: 'Sent for approval' }).click() await expect( - page.getByText(formatName(declaration.child.name[0])).first() + page + .getByText(formatNameWithFirstNameFirst(declaration.child.name[0])) + .first() ).toBeVisible() }) test.describe('2.8 Correction Approval', async () => { @@ -937,7 +940,10 @@ test.describe.serial('Correct record - 2', () => { await expect(page.getByText('Submitter' + 'Felix Katongo')).toBeVisible() await expect( - page.getByText('Requested by' + formatName(declaration.father.name[0])) + page.getByText( + 'Requested by' + + formatNameWithFirstNameFirst(declaration.father.name[0]) + ) ).toBeVisible() await expect( diff --git a/e2e/testcases/correction-birth/correct-birth-record-3.spec.ts b/e2e/testcases/correction-birth/correct-birth-record-3.spec.ts index e3782a59e..c9c561587 100644 --- a/e2e/testcases/correction-birth/correct-birth-record-3.spec.ts +++ b/e2e/testcases/correction-birth/correct-birth-record-3.spec.ts @@ -6,6 +6,7 @@ import { expectOutboxToBeEmpty, formatDateTo_ddMMMMyyyy, formatName, + formatNameWithFirstNameFirst, getAction, getToken, goBackToReview, @@ -145,13 +146,15 @@ test.describe.serial(' Correct record - 3', () => { await expectOutboxToBeEmpty(page) await page.getByRole('button', { name: 'Ready to issue' }).click() await expect( - page.getByText(formatName(declaration.child.name[0])).first() + page + .getByText(formatNameWithFirstNameFirst(declaration.child.name[0])) + .first() ).toBeVisible() }) test('3.1.3 Record audit', async () => { await page - .getByText(formatName(declaration.child.name[0])) + .getByText(formatNameWithFirstNameFirst(declaration.child.name[0])) .first() .click() await assignRecord(page) @@ -772,8 +775,8 @@ test.describe.serial(' Correct record - 3', () => { await expect( page.getByText( 'Full name (mother)' + - formatName(declaration.mother.name[0]) + - formatName(updatedMotherDetails) + formatNameWithFirstNameFirst(declaration.mother.name[0]) + + formatNameWithFirstNameFirst(updatedMotherDetails) ) ).toBeVisible() @@ -840,7 +843,7 @@ test.describe.serial(' Correct record - 3', () => { ).toBeVisible() await expect( - page.getByText(formatName(declaration.child.name[0])) + page.getByText(formatNameWithFirstNameFirst(declaration.child.name[0])) ).toBeVisible() await expect(page.getByText('Verified')).toBeVisible() await expect( diff --git a/e2e/testcases/correction-birth/correct-birth-record-4.spec.ts b/e2e/testcases/correction-birth/correct-birth-record-4.spec.ts index 462ced7ed..b0d22da95 100644 --- a/e2e/testcases/correction-birth/correct-birth-record-4.spec.ts +++ b/e2e/testcases/correction-birth/correct-birth-record-4.spec.ts @@ -7,6 +7,7 @@ import { formatDateTo_ddMMMMyyyy, formatDateTo_yyyyMMdd, formatName, + formatNameWithFirstNameFirst, getAction, getToken, goBackToReview, @@ -674,8 +675,8 @@ test.describe.serial(' Correct record - 4', () => { await expect( page.getByText( 'Full name (father)' + - formatName(declaration.father.name[0]) + - formatName(updatedFatherDetails) + formatNameWithFirstNameFirst(declaration.father.name[0]) + + formatNameWithFirstNameFirst(updatedFatherDetails) ) ).toBeVisible() @@ -765,11 +766,16 @@ test.describe.serial(' Correct record - 4', () => { */ await expect( - page.getByText(formatName(declaration.child.name[0])).first() + page + .getByText(formatNameWithFirstNameFirst(declaration.child.name[0])) + .first() ).toBeVisible() }) test('4.8 Validate history in record audit', async () => { - await page.getByText(formatName(declaration.child.name[0])).first().click() + await page + .getByText(formatNameWithFirstNameFirst(declaration.child.name[0])) + .first() + .click() await assignRecord(page) diff --git a/e2e/testcases/correction-birth/correct-birth-record-5.spec.ts b/e2e/testcases/correction-birth/correct-birth-record-5.spec.ts index 862ddc1da..2d4fa8fd9 100644 --- a/e2e/testcases/correction-birth/correct-birth-record-5.spec.ts +++ b/e2e/testcases/correction-birth/correct-birth-record-5.spec.ts @@ -6,6 +6,7 @@ import { expectOutboxToBeEmpty, formatDateTo_ddMMMMyyyy, formatName, + formatNameWithFirstNameFirst, getAction, getToken, goBackToReview, @@ -565,8 +566,8 @@ test.describe.serial(' Correct record - 5', () => { await expect( page.getByText( 'Full name (Child)' + - formatName(declaration.child.name[0]) + - formatName(updatedChildDetails) + formatNameWithFirstNameFirst(declaration.child.name[0]) + + formatNameWithFirstNameFirst(updatedChildDetails) ) ).toBeVisible() @@ -654,10 +655,14 @@ test.describe.serial(' Correct record - 5', () => { * - include the declaration in this tab */ - await expect(page.getByText(formatName(updatedChildDetails))).toBeVisible() + await expect( + page.getByText(formatNameWithFirstNameFirst(updatedChildDetails)) + ).toBeVisible() }) test('5.8 Validate history in record audit', async () => { - await page.getByText(formatName(updatedChildDetails)).click() + await page + .getByText(formatNameWithFirstNameFirst(updatedChildDetails)) + .click() await assignRecord(page) diff --git a/e2e/testcases/correction-birth/correct-birth-record-6.spec.ts b/e2e/testcases/correction-birth/correct-birth-record-6.spec.ts index 892bc3ce3..3716c4de2 100644 --- a/e2e/testcases/correction-birth/correct-birth-record-6.spec.ts +++ b/e2e/testcases/correction-birth/correct-birth-record-6.spec.ts @@ -6,6 +6,7 @@ import { expectOutboxToBeEmpty, formatDateTo_ddMMMMyyyy, formatName, + formatNameWithFirstNameFirst, getAction, getToken, goBackToReview, @@ -130,11 +131,13 @@ test.describe.serial(' Correct record - 6', () => { await expectOutboxToBeEmpty(page) await expect( - page.getByText(formatName(declaration.child.name[0])).first() + page + .getByText(formatNameWithFirstNameFirst(declaration.child.name[0])) + .first() ).toBeVisible() await page - .getByText(formatName(declaration.child.name[0])) + .getByText(formatNameWithFirstNameFirst(declaration.child.name[0])) .first() .click() }) @@ -622,8 +625,8 @@ test.describe.serial(' Correct record - 6', () => { await expect( page.getByText( 'Full name (informant)' + - formatName(declaration.informant.name[0]) + - formatName(updatedInformantDetails) + formatNameWithFirstNameFirst(declaration.informant.name[0]) + + formatNameWithFirstNameFirst(updatedInformantDetails) ) ).toBeVisible() @@ -704,11 +707,13 @@ test.describe.serial(' Correct record - 6', () => { */ await expect( - page.getByText(formatName(declaration.child.name[0])) + page.getByText(formatNameWithFirstNameFirst(declaration.child.name[0])) ).toBeVisible() }) test('6.8 Validate history in record audit', async () => { - await page.getByText(formatName(declaration.child.name[0])).click() + await page + .getByText(formatNameWithFirstNameFirst(declaration.child.name[0])) + .click() await assignRecord(page) diff --git a/e2e/testcases/correction-birth/correct-birth-record-7.spec.ts b/e2e/testcases/correction-birth/correct-birth-record-7.spec.ts index 41502a21a..e5709406b 100644 --- a/e2e/testcases/correction-birth/correct-birth-record-7.spec.ts +++ b/e2e/testcases/correction-birth/correct-birth-record-7.spec.ts @@ -5,6 +5,7 @@ import { expectAddress, expectOutboxToBeEmpty, formatName, + formatNameWithFirstNameFirst, getAction, getToken, goBackToReview, @@ -455,8 +456,8 @@ test.describe.serial(' Correct record - 7', () => { await expect( page.getByText( 'Full name (mother)' + - formatName(declaration.mother.name[0]) + - formatName(updatedMotherDetails) + formatNameWithFirstNameFirst(declaration.mother.name[0]) + + formatNameWithFirstNameFirst(updatedMotherDetails) ) ).toBeVisible() @@ -553,11 +554,16 @@ test.describe.serial(' Correct record - 7', () => { */ await expect( - page.getByText(formatName(declaration.child.name[0])).first() + page + .getByText(formatNameWithFirstNameFirst(declaration.child.name[0])) + .first() ).toBeVisible() }) test('7.8 Validate history in record audit', async () => { - await page.getByText(formatName(declaration.child.name[0])).first().click() + await page + .getByText(formatNameWithFirstNameFirst(declaration.child.name[0])) + .first() + .click() await assignRecord(page) diff --git a/e2e/testcases/correction-birth/correct-birth-record-8.spec.ts b/e2e/testcases/correction-birth/correct-birth-record-8.spec.ts index 40cc78e8e..90b3d2358 100644 --- a/e2e/testcases/correction-birth/correct-birth-record-8.spec.ts +++ b/e2e/testcases/correction-birth/correct-birth-record-8.spec.ts @@ -6,6 +6,7 @@ import { expectOutboxToBeEmpty, formatDateTo_ddMMMMyyyy, formatName, + formatNameWithFirstNameFirst, getAction, getToken, goBackToReview, @@ -430,8 +431,8 @@ test.describe.serial(' Correct record - 8', () => { await expect( page.getByText( 'Full name (father)' + - formatName(declaration.father.name[0]) + - formatName(updatedFatherDetails) + formatNameWithFirstNameFirst(declaration.father.name[0]) + + formatNameWithFirstNameFirst(updatedFatherDetails) ) ).toBeVisible() @@ -516,12 +517,17 @@ test.describe.serial(' Correct record - 8', () => { */ await expect( - page.getByText(formatName(declaration.child.name[0])).first() + page + .getByText(formatNameWithFirstNameFirst(declaration.child.name[0])) + .first() ).toBeVisible() }) test('8.8 Validate history in record audit', async () => { - await page.getByText(formatName(declaration.child.name[0])).first().click() + await page + .getByText(formatNameWithFirstNameFirst(declaration.child.name[0])) + .first() + .click() await assignRecord(page) diff --git a/e2e/testcases/correction-birth/correct-birth-record-9.spec.ts b/e2e/testcases/correction-birth/correct-birth-record-9.spec.ts index 7b7748570..6ad49da2f 100644 --- a/e2e/testcases/correction-birth/correct-birth-record-9.spec.ts +++ b/e2e/testcases/correction-birth/correct-birth-record-9.spec.ts @@ -6,6 +6,7 @@ import { expectOutboxToBeEmpty, formatDateTo_ddMMMMyyyy, formatName, + formatNameWithFirstNameFirst, getAction, getToken, goBackToReview, @@ -130,11 +131,13 @@ test.describe.serial(' Correct record - 9', () => { await expectOutboxToBeEmpty(page) await page.getByRole('button', { name: 'Ready to issue' }).click() await expect( - page.getByText(formatName(declaration.child.name[0])).first() + page + .getByText(formatNameWithFirstNameFirst(declaration.child.name[0])) + .first() ).toBeVisible() await page - .getByText(formatName(declaration.child.name[0])) + .getByText(formatNameWithFirstNameFirst(declaration.child.name[0])) .first() .click() }) @@ -626,8 +629,8 @@ test.describe.serial(' Correct record - 9', () => { await expect( page.getByText( 'Full name (informant)' + - formatName(declaration.informant.name[0]) + - formatName(updatedInformantDetails) + formatNameWithFirstNameFirst(declaration.informant.name[0]) + + formatNameWithFirstNameFirst(updatedInformantDetails) ) ).toBeVisible() @@ -708,11 +711,16 @@ test.describe.serial(' Correct record - 9', () => { */ await expect( - page.getByText(formatName(declaration.child.name[0])).first() + page + .getByText(formatNameWithFirstNameFirst(declaration.child.name[0])) + .first() ).toBeVisible() }) test('9.8 Validate history in record audit', async () => { - await page.getByText(formatName(declaration.child.name[0])).first().click() + await page + .getByText(formatNameWithFirstNameFirst(declaration.child.name[0])) + .first() + .click() await assignRecord(page) diff --git a/e2e/testcases/correction-death/correct-death-record-10.spec.ts b/e2e/testcases/correction-death/correct-death-record-10.spec.ts index 8f2053535..0f46fa64c 100644 --- a/e2e/testcases/correction-death/correct-death-record-10.spec.ts +++ b/e2e/testcases/correction-death/correct-death-record-10.spec.ts @@ -6,6 +6,7 @@ import { expectOutboxToBeEmpty, formatDateTo_ddMMMMyyyy, formatName, + formatNameWithFirstNameFirst, getAction, getToken, goBackToReview, @@ -800,8 +801,8 @@ test.describe('10. Correct record - 10', () => { await expect( page.getByText( 'Full name (Deceased)' + - formatName(declaration.deceased.name[0]) + - formatName(updatedDeceasedDetails) + formatNameWithFirstNameFirst(declaration.deceased.name[0]) + + formatNameWithFirstNameFirst(updatedDeceasedDetails) ) ).toBeVisible() @@ -875,7 +876,9 @@ test.describe('10. Correct record - 10', () => { ).toBeVisible() await expect( - page.getByText(formatName(declaration.informant.name[0])) + page.getByText( + formatNameWithFirstNameFirst(declaration.informant.name[0]) + ) ).toBeVisible() await expect(page.getByText('Verified')).toBeVisible() await expect( @@ -908,7 +911,11 @@ test.describe('10. Correct record - 10', () => { await expectOutboxToBeEmpty(page) await page.getByRole('button', { name: 'Sent for approval' }).click() await expect( - page.getByText(formatName(declaration.deceased.name[0])).first() + page + .getByText( + formatNameWithFirstNameFirst(declaration.deceased.name[0]) + ) + .first() ).toBeVisible() }) }) diff --git a/e2e/testcases/correction-death/correct-death-record-11.spec.ts b/e2e/testcases/correction-death/correct-death-record-11.spec.ts index a87d614a1..5d94a9ea7 100644 --- a/e2e/testcases/correction-death/correct-death-record-11.spec.ts +++ b/e2e/testcases/correction-death/correct-death-record-11.spec.ts @@ -7,6 +7,7 @@ import { formatDateTo_ddMMMMyyyy, formatDateTo_yyyyMMdd, formatName, + formatNameWithFirstNameFirst, getAction, getToken, goBackToReview, @@ -442,7 +443,9 @@ test.describe.serial(' Correct record - 11', () => { await expectOutboxToBeEmpty(page) await page.getByRole('button', { name: 'Sent for approval' }).click() await expect( - page.getByText(formatName(declaration.deceased.name[0])).first() + page + .getByText(formatNameWithFirstNameFirst(declaration.deceased.name[0])) + .first() ).toBeVisible() }) test.describe('11.8 Correction Approval', async () => { @@ -558,13 +561,15 @@ test.describe.serial(' Correct record - 11', () => { await expectOutboxToBeEmpty(page) await page.getByRole('button', { name: 'Ready to print' }).click() await expect( - page.getByText(formatName(declaration.deceased.name[0])).first() + page + .getByText(formatNameWithFirstNameFirst(declaration.deceased.name[0])) + .first() ).toBeVisible() }) test('11.8.4 Validate history in record audit', async () => { await page - .getByText(formatName(declaration.deceased.name[0])) + .getByText(formatNameWithFirstNameFirst(declaration.deceased.name[0])) .first() .click() diff --git a/e2e/testcases/correction-death/correct-death-record-12.spec.ts b/e2e/testcases/correction-death/correct-death-record-12.spec.ts index 2c2ca8048..88e2b93ed 100644 --- a/e2e/testcases/correction-death/correct-death-record-12.spec.ts +++ b/e2e/testcases/correction-death/correct-death-record-12.spec.ts @@ -6,6 +6,7 @@ import { expectOutboxToBeEmpty, formatDateTo_ddMMMMyyyy, formatName, + formatNameWithFirstNameFirst, getAction, getToken, goBackToReview, @@ -139,12 +140,16 @@ test.describe.serial(' Correct record - 12', () => { await expectOutboxToBeEmpty(page) await page.getByRole('button', { name: 'Ready to issue' }).click() await expect( - page.getByText(formatName(declaration.deceased.name[0])) + page.getByText( + formatNameWithFirstNameFirst(declaration.deceased.name[0]) + ) ).toBeVisible() }) test('12.1.3 Record audit', async () => { - await page.getByText(formatName(declaration.deceased.name[0])).click() + await page + .getByText(formatNameWithFirstNameFirst(declaration.deceased.name[0])) + .click() await assignRecord(page) /* * Expected result: should show correct record button @@ -749,8 +754,8 @@ test.describe.serial(' Correct record - 12', () => { await expect( page.getByText( 'Full name (informant)' + - formatName(declaration.informant.name[0]) + - formatName(updatedInformantDetails) + formatNameWithFirstNameFirst(declaration.informant.name[0]) + + formatNameWithFirstNameFirst(updatedInformantDetails) ) ).toBeVisible() diff --git a/e2e/testcases/correction-death/correct-death-record-13.spec.ts b/e2e/testcases/correction-death/correct-death-record-13.spec.ts index 7cd487ef5..a11c5cd79 100644 --- a/e2e/testcases/correction-death/correct-death-record-13.spec.ts +++ b/e2e/testcases/correction-death/correct-death-record-13.spec.ts @@ -6,6 +6,7 @@ import { expectOutboxToBeEmpty, formatDateTo_ddMMMMyyyy, formatName, + formatNameWithFirstNameFirst, getAction, getToken, goBackToReview, @@ -572,8 +573,8 @@ test.describe.serial(' Correct record - 13', () => { await expect( page.getByText( 'Full name (Spouse details)' + - formatName(declaration.spouse.name[0]) + - formatName(updatedSpouseDetails) + formatNameWithFirstNameFirst(declaration.spouse.name[0]) + + formatNameWithFirstNameFirst(updatedSpouseDetails) ) ).toBeVisible() @@ -675,12 +676,14 @@ test.describe.serial(' Correct record - 13', () => { await page.getByRole('button', { name: 'Ready to print' }).click() await expect( - page.getByText(formatName(declaration.deceased.name[0])).first() + page + .getByText(formatNameWithFirstNameFirst(declaration.deceased.name[0])) + .first() ).toBeVisible() }) test('13.8 Validate history in record audit', async () => { await page - .getByText(formatName(declaration.deceased.name[0])) + .getByText(formatNameWithFirstNameFirst(declaration.deceased.name[0])) .first() .click() diff --git a/e2e/testcases/correction-death/correct-death-record-14.spec.ts b/e2e/testcases/correction-death/correct-death-record-14.spec.ts index 2f4f7526d..3b08f3aea 100644 --- a/e2e/testcases/correction-death/correct-death-record-14.spec.ts +++ b/e2e/testcases/correction-death/correct-death-record-14.spec.ts @@ -6,6 +6,7 @@ import { expectOutboxToBeEmpty, formatDateTo_ddMMMMyyyy, formatName, + formatNameWithFirstNameFirst, getAction, getToken, goBackToReview, @@ -627,8 +628,8 @@ test.describe.serial(' Correct record - 14', () => { await expect( page.getByText( 'Full name (Deceased)' + - formatName(declaration.deceased.name[0]) + - formatName(updatedDeceasedDetails) + formatNameWithFirstNameFirst(declaration.deceased.name[0]) + + formatNameWithFirstNameFirst(updatedDeceasedDetails) ) ).toBeVisible() @@ -718,11 +719,13 @@ test.describe.serial(' Correct record - 14', () => { */ await expect( - page.getByText(formatName(updatedDeceasedDetails)) + page.getByText(formatNameWithFirstNameFirst(updatedDeceasedDetails)) ).toBeVisible() }) test('14.8 Validate history in record audit', async () => { - await page.getByText(formatName(updatedDeceasedDetails)).click() + await page + .getByText(formatNameWithFirstNameFirst(updatedDeceasedDetails)) + .click() await assignRecord(page) diff --git a/e2e/testcases/correction-death/correct-death-record-15.spec.ts b/e2e/testcases/correction-death/correct-death-record-15.spec.ts index 909bee496..e65feff05 100644 --- a/e2e/testcases/correction-death/correct-death-record-15.spec.ts +++ b/e2e/testcases/correction-death/correct-death-record-15.spec.ts @@ -6,6 +6,7 @@ import { formatDateTo_ddMMMMyyyy, formatDateTo_yyyyMMdd, formatName, + formatNameWithFirstNameFirst, getAction, getLocationNameFromFhirId, getToken, @@ -104,7 +105,7 @@ test.describe.serial(' Correct record - 15', () => { await expectOutboxToBeEmpty(page) await page.getByRole('button', { name: 'Ready to issue' }).click() await page - .getByText(formatName(declaration.deceased.name[0])) + .getByText(formatNameWithFirstNameFirst(declaration.deceased.name[0])) .first() .click() }) @@ -487,7 +488,9 @@ test.describe.serial(' Correct record - 15', () => { ).toBeVisible() await expect( - page.getByText(formatName(declaration.informant.name[0])) + page.getByText( + formatNameWithFirstNameFirst(declaration.informant.name[0]) + ) ).toBeVisible() await expect(page.getByText('Identity does not match')).toBeVisible() diff --git a/e2e/testcases/correction-death/correct-death-record-16.spec.ts b/e2e/testcases/correction-death/correct-death-record-16.spec.ts index 88f067d93..c6aadae0f 100644 --- a/e2e/testcases/correction-death/correct-death-record-16.spec.ts +++ b/e2e/testcases/correction-death/correct-death-record-16.spec.ts @@ -6,6 +6,7 @@ import { expectOutboxToBeEmpty, formatDateTo_ddMMMMyyyy, formatName, + formatNameWithFirstNameFirst, getAction, getToken, goBackToReview, @@ -578,8 +579,8 @@ test.describe.serial(' Correct record - 16', () => { await expect( page.getByText( 'Full name (informant)' + - formatName(declaration.informant.name[0]) + - formatName(updatedInformantDetails) + formatNameWithFirstNameFirst(declaration.informant.name[0]) + + formatNameWithFirstNameFirst(updatedInformantDetails) ) ).toBeVisible() @@ -674,12 +675,14 @@ test.describe.serial(' Correct record - 16', () => { */ await expect( - page.getByText(formatName(declaration.deceased.name[0])).first() + page + .getByText(formatNameWithFirstNameFirst(declaration.deceased.name[0])) + .first() ).toBeVisible() }) test('16.8 Validate history in record audit', async () => { await page - .getByText(formatName(declaration.deceased.name[0])) + .getByText(formatNameWithFirstNameFirst(declaration.deceased.name[0])) .first() .click() diff --git a/e2e/testcases/correction-death/correct-death-record-17.spec.ts b/e2e/testcases/correction-death/correct-death-record-17.spec.ts index b918e4e3a..ee52eaeeb 100644 --- a/e2e/testcases/correction-death/correct-death-record-17.spec.ts +++ b/e2e/testcases/correction-death/correct-death-record-17.spec.ts @@ -6,6 +6,7 @@ import { expectOutboxToBeEmpty, formatDateTo_ddMMMMyyyy, formatName, + formatNameWithFirstNameFirst, getAction, getToken, goBackToReview, @@ -481,8 +482,8 @@ test.describe.serial(' Correct record - 17', () => { await expect( page.getByText( 'Full name (Spouse details)' + - formatName(declaration.spouse.name[0]) + - formatName(updatedSpouseDetails) + formatNameWithFirstNameFirst(declaration.spouse.name[0]) + + formatNameWithFirstNameFirst(updatedSpouseDetails) ) ).toBeVisible() @@ -561,12 +562,14 @@ test.describe.serial(' Correct record - 17', () => { */ await expect( - page.getByText(formatName(declaration.deceased.name[0])).first() + page + .getByText(formatNameWithFirstNameFirst(declaration.deceased.name[0])) + .first() ).toBeVisible() }) test('17.8 Validate history in record audit', async () => { await page - .getByText(formatName(declaration.deceased.name[0])) + .getByText(formatNameWithFirstNameFirst(declaration.deceased.name[0])) .first() .click() diff --git a/e2e/testcases/correction-death/correct-death-record-18.spec.ts b/e2e/testcases/correction-death/correct-death-record-18.spec.ts index 2fc22c5ce..fc3cee345 100644 --- a/e2e/testcases/correction-death/correct-death-record-18.spec.ts +++ b/e2e/testcases/correction-death/correct-death-record-18.spec.ts @@ -5,6 +5,7 @@ import { expectAddress, expectOutboxToBeEmpty, formatName, + formatNameWithFirstNameFirst, getAction, getToken, goBackToReview, @@ -104,11 +105,13 @@ test.describe.serial(' Correct record - 18', () => { await expectOutboxToBeEmpty(page) await page.getByRole('button', { name: 'Ready to issue' }).click() await expect( - page.getByText(formatName(declaration.deceased.name[0])).first() + page + .getByText(formatNameWithFirstNameFirst(declaration.deceased.name[0])) + .first() ).toBeVisible() await page - .getByText(formatName(declaration.deceased.name[0])) + .getByText(formatNameWithFirstNameFirst(declaration.deceased.name[0])) .first() .click() }) @@ -656,8 +659,8 @@ test.describe.serial(' Correct record - 18', () => { await expect( page.getByText( 'Full name (Deceased)' + - formatName(declaration.deceased.name[0]) + - formatName(updatedDeceasedDetails) + formatNameWithFirstNameFirst(declaration.deceased.name[0]) + + formatNameWithFirstNameFirst(updatedDeceasedDetails) ) ).toBeVisible()