From c9bfbcfa532413b250aaa887a69251946883b3a4 Mon Sep 17 00:00:00 2001 From: Tameem Bin Haider Date: Fri, 10 Jan 2025 19:10:07 +0600 Subject: [PATCH] chore: change in-progress to my-drafts (e2e) (#1196) * chore: change in-progress to my-drafts * fix: update fetch registration queries --------- Co-authored-by: Md. Ashikul Alam --- .../birth/1-birth-event-declaration.spec.ts | 12 ++--- e2e/testcases/birth/queries.ts | 52 +++++++++++++++++-- .../death/1-death-event-declaration.spec.ts | 12 ++--- e2e/testcases/death/queries.ts | 47 +++++++++++++++-- 4 files changed, 101 insertions(+), 22 deletions(-) diff --git a/e2e/testcases/birth/1-birth-event-declaration.spec.ts b/e2e/testcases/birth/1-birth-event-declaration.spec.ts index 78426dfaf..69335fbcc 100644 --- a/e2e/testcases/birth/1-birth-event-declaration.spec.ts +++ b/e2e/testcases/birth/1-birth-event-declaration.spec.ts @@ -426,10 +426,10 @@ test.describe('1. Birth event declaration', () => { /* * Expected result: should - * - be navigated to "in-progress" tab + * - be navigated to "my-drafts" tab * - find the declared birth event record on this page list with saved data */ - await expect(page.locator('#content-name')).toHaveText('In progress') + await expect(page.locator('#content-name')).toHaveText('My drafts') await expect(page.getByText(/seconds ago/)).toBeVisible() }) }) @@ -483,13 +483,13 @@ test.describe('1. Birth event declaration', () => { test('1.10.3 Click Confirm', async ({ page }) => { await page.getByRole('button', { name: 'Confirm' }).click() /* - * Expected result: should be navigated to "in-progress" tab but no draft will be saved + * Expected result: should be navigated to "my-drafts" tab but no draft will be saved */ await page.waitForTimeout(500) // This page renders twice at first await expect( - page.locator('#content-name', { hasText: 'In progress' }) + page.locator('#content-name', { hasText: 'My drafts' }) ).toBeVisible() await expect(page.getByText(/seconds ago/)).toBeHidden() }) @@ -552,13 +552,13 @@ test.describe('1. Birth event declaration', () => { await page.getByRole('button', { name: 'Confirm' }).click() /* - * Expected result: should be navigated to "in-progress" tab but no draft will be saved + * Expected result: should be navigated to "my-drafts" tab but no draft will be saved */ await page.waitForTimeout(500) // This page renders twice at first await expect( - page.locator('#content-name', { hasText: 'In progress' }) + page.locator('#content-name', { hasText: 'My drafts' }) ).toBeVisible() await expect(page.getByText(/seconds ago/)).toBeHidden() }) diff --git a/e2e/testcases/birth/queries.ts b/e2e/testcases/birth/queries.ts index b4c30bc7d..b14dd2f87 100644 --- a/e2e/testcases/birth/queries.ts +++ b/e2e/testcases/birth/queries.ts @@ -150,6 +150,31 @@ export const GET_BIRTH_REGISTRATION_FOR_REVIEW = print(gql` contactRelationship contactPhoneNumber contactEmail + assignment { + practitionerId + firstName + lastName + officeName + avatarURL + } + certificates { + hasShowedVerifiedDocument + certificateTemplateId + collector { + relationship + otherRelationship + name { + use + firstNames + familyName + } + telecom { + system + value + use + } + } + } duplicates { compositionId trackingId @@ -207,6 +232,7 @@ export const GET_BIRTH_REGISTRATION_FOR_REVIEW = print(gql` requesterOther noSupportingDocumentationRequired hasShowedVerifiedDocument + certificateTemplateId date action regStatus @@ -250,13 +276,13 @@ export const GET_BIRTH_REGISTRATION_FOR_REVIEW = print(gql` user { id role { - _id - labels { - lang - label + id + label { + id + defaultMessage + description } } - systemRole name { firstNames familyName @@ -295,6 +321,7 @@ export const GET_BIRTH_REGISTRATION_FOR_REVIEW = print(gql` } certificates { hasShowedVerifiedDocument + certificateTemplateId collector { relationship otherRelationship @@ -309,6 +336,21 @@ export const GET_BIRTH_REGISTRATION_FOR_REVIEW = print(gql` use } } + certifier { + name { + use + firstNames + familyName + } + role { + id + label { + id + defaultMessage + description + } + } + } } duplicateOf potentialDuplicates diff --git a/e2e/testcases/death/1-death-event-declaration.spec.ts b/e2e/testcases/death/1-death-event-declaration.spec.ts index 1f9d2e9c5..dfc7e8d54 100644 --- a/e2e/testcases/death/1-death-event-declaration.spec.ts +++ b/e2e/testcases/death/1-death-event-declaration.spec.ts @@ -406,10 +406,10 @@ test.describe('1. Death event declaration', () => { /* * Expected result: should - * - be navigated to "in-progress" tab + * - be navigated to "my-drafts" tab * - find the declared death event record on this page list with saved data */ - await expect(page.locator('#content-name')).toHaveText('In progress') + await expect(page.locator('#content-name')).toHaveText('My drafts') await expect(page.getByText(/seconds ago/)).toBeVisible() }) }) @@ -463,13 +463,13 @@ test.describe('1. Death event declaration', () => { test('1.10.3 Click Confirm', async ({ page }) => { await page.getByRole('button', { name: 'Confirm' }).click() /* - * Expected result: should be navigated to "in-progress" tab but no draft will be saved + * Expected result: should be navigated to "my-drafts" tab but no draft will be saved */ await page.waitForTimeout(500) // This page renders twice at first await expect( - page.locator('#content-name', { hasText: 'In progress' }) + page.locator('#content-name', { hasText: 'My drafts' }) ).toBeVisible() await expect(page.getByText(/seconds ago/)).toBeHidden() }) @@ -532,13 +532,13 @@ test.describe('1. Death event declaration', () => { await page.getByRole('button', { name: 'Confirm' }).click() /* - * Expected result: should be navigated to "in-progress" tab but no draft will be saved + * Expected result: should be navigated to "my-drafts" tab but no draft will be saved */ await page.waitForTimeout(500) // This page renders twice at first await expect( - page.locator('#content-name', { hasText: 'In progress' }) + page.locator('#content-name', { hasText: 'My drafts' }) ).toBeVisible() await expect(page.getByText(/seconds ago/)).toBeHidden() }) diff --git a/e2e/testcases/death/queries.ts b/e2e/testcases/death/queries.ts index 52eb3734b..d994b913d 100644 --- a/e2e/testcases/death/queries.ts +++ b/e2e/testcases/death/queries.ts @@ -214,6 +214,24 @@ export const GET_DEATH_REGISTRATION_FOR_REVIEW = print(gql` contactRelationship contactPhoneNumber contactEmail + certificates { + hasShowedVerifiedDocument + certificateTemplateId + collector { + relationship + otherRelationship + name { + use + firstNames + familyName + } + telecom { + system + value + use + } + } + } duplicates { compositionId trackingId @@ -287,7 +305,9 @@ export const GET_DEATH_REGISTRATION_FOR_REVIEW = print(gql` } otherReason requester + requesterOther hasShowedVerifiedDocument + certificateTemplateId noSupportingDocumentationRequired date action @@ -318,13 +338,14 @@ export const GET_DEATH_REGISTRATION_FOR_REVIEW = print(gql` user { id role { - _id - labels { - lang - label + id + label { + id + defaultMessage + description } } - systemRole + name { firstNames familyName @@ -363,6 +384,7 @@ export const GET_DEATH_REGISTRATION_FOR_REVIEW = print(gql` } certificates { hasShowedVerifiedDocument + certificateTemplateId collector { relationship otherRelationship @@ -377,6 +399,21 @@ export const GET_DEATH_REGISTRATION_FOR_REVIEW = print(gql` use } } + certifier { + name { + use + firstNames + familyName + } + role { + id + label { + id + defaultMessage + description + } + } + } } duplicateOf potentialDuplicates