Skip to content

Commit

Permalink
chore: change in-progress to my-drafts (e2e) (#1196)
Browse files Browse the repository at this point in the history
* chore: change in-progress to my-drafts

* fix: update fetch registration queries

---------

Co-authored-by: Md. Ashikul Alam <ashikul.alam@dsinnovators.com>
  • Loading branch information
Zangetsu101 and Nil20 authored Jan 10, 2025
1 parent b9a3f86 commit c9bfbcf
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 22 deletions.
12 changes: 6 additions & 6 deletions e2e/testcases/birth/1-birth-event-declaration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
})
})
Expand Down Expand Up @@ -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()
})
Expand Down Expand Up @@ -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()
})
Expand Down
52 changes: 47 additions & 5 deletions e2e/testcases/birth/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -207,6 +232,7 @@ export const GET_BIRTH_REGISTRATION_FOR_REVIEW = print(gql`
requesterOther
noSupportingDocumentationRequired
hasShowedVerifiedDocument
certificateTemplateId
date
action
regStatus
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -295,6 +321,7 @@ export const GET_BIRTH_REGISTRATION_FOR_REVIEW = print(gql`
}
certificates {
hasShowedVerifiedDocument
certificateTemplateId
collector {
relationship
otherRelationship
Expand All @@ -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
Expand Down
12 changes: 6 additions & 6 deletions e2e/testcases/death/1-death-event-declaration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
})
})
Expand Down Expand Up @@ -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()
})
Expand Down Expand Up @@ -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()
})
Expand Down
47 changes: 42 additions & 5 deletions e2e/testcases/death/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -287,7 +305,9 @@ export const GET_DEATH_REGISTRATION_FOR_REVIEW = print(gql`
}
otherReason
requester
requesterOther
hasShowedVerifiedDocument
certificateTemplateId
noSupportingDocumentationRequired
date
action
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -363,6 +384,7 @@ export const GET_DEATH_REGISTRATION_FOR_REVIEW = print(gql`
}
certificates {
hasShowedVerifiedDocument
certificateTemplateId
collector {
relationship
otherRelationship
Expand All @@ -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
Expand Down

0 comments on commit c9bfbcf

Please sign in to comment.