Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
711d65b
upgrade toolkit, add temporary conditional to approve action
cibelius Nov 21, 2025
35eb599
Merge remote-tracking branch 'upstream/ocrvs-10890' into ocrvs-10890
cibelius Nov 24, 2025
4c52151
switch to conditionaltype show
cibelius Nov 24, 2025
09e1ada
Merge remote-tracking branch 'origin/develop' into ocrvs-10890
cibelius Nov 24, 2025
5201f29
Merge remote-tracking branch 'upstream/ocrvs-10890' into ocrvs-10890
cibelius Nov 24, 2025
6da237e
skip test for now
cibelius Nov 24, 2025
47b2b59
fix test
cibelius Nov 24, 2025
a1adb7c
Merge remote-tracking branch 'origin/develop' into ocrvs-10890
cibelius Nov 24, 2025
0bd717a
Merge remote-tracking branch 'upstream/ocrvs-10890' into ocrvs-10890
cibelius Nov 24, 2025
39c580d
Merge branch 'develop' into ocrvs-10890
cibelius Nov 24, 2025
7ffae13
upgrade toolkit
cibelius Nov 25, 2025
a2169e0
Merge remote-tracking branch 'origin/develop' into ocrvs-10890
cibelius Nov 25, 2025
0de528d
Merge remote-tracking branch 'origin/develop' into ocrvs-10890
cibelius Nov 25, 2025
4730ce2
Merge remote-tracking branch 'upstream/ocrvs-10890' into ocrvs-10890
cibelius Nov 25, 2025
5be738d
Merge remote-tracking branch 'origin/develop' into ocrvs-10890
cibelius Nov 25, 2025
062a9c2
Merge remote-tracking branch 'origin/develop' into ocrvs-10890
cibelius Nov 25, 2025
32f6868
Merge remote-tracking branch 'upstream/ocrvs-10890' into ocrvs-10890
cibelius Nov 25, 2025
90c0e79
fix flag
cibelius Nov 26, 2025
a58b3ce
Merge remote-tracking branch 'upstream/ocrvs-10890' into ocrvs-10890
cibelius Nov 26, 2025
7f9b9c7
fix test cases
cibelius Nov 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 4 additions & 18 deletions e2e/testcases/action-menu/action-menu-options.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ async function getActionMenuOptions(page: Page, declaration: Declaration) {
return textContents
}

// @TODO: these tests are disabled for now, as our work in custom actions temporarily affects these in a manner which is not intended
// These will be brought back in to use after the custom actions are hidden on the action menu correctly.
test.describe.skip('Action menu options', () => {
test.describe('Action menu options', () => {
let page: Page

test.beforeEach(async ({ browser }) => {
Expand Down Expand Up @@ -53,13 +51,7 @@ test.describe.skip('Action menu options', () => {
await login(page, CREDENTIALS.LOCAL_REGISTRAR)
await page.getByRole('button', { name: 'Ready for review' }).click()
const options = await getActionMenuOptions(page, declaration)
expect(options).toStrictEqual([
'Assign',
'Register',
'Archive',
'Reject',
'Approve'
])
expect(options).toStrictEqual(['Assign', 'Register', 'Archive', 'Reject'])
})
})

Expand All @@ -83,8 +75,7 @@ test.describe.skip('Action menu options', () => {
'Unassign',
'Register',
'Archive',
'Reject',
'Approve'
'Reject'
])
})
})
Expand All @@ -105,12 +96,7 @@ test.describe.skip('Action menu options', () => {
await login(page, CREDENTIALS.LOCAL_REGISTRAR)
await page.getByRole('button', { name: 'Ready to print' }).click()
const options = await getActionMenuOptions(page, declaration)
expect(options).toStrictEqual([
'Assign',
'Print',
'Correct record',
'Approve'
])
expect(options).toStrictEqual(['Assign', 'Print', 'Correct record'])
})
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import { ensureAssigned, ensureOutboxIsEmpty, selectAction } from '../../utils'
test.describe.serial('Approval of late birth registration', () => {
let page: Page
const childName = {
firstNames: faker.person.firstName('male'),
familyName: faker.person.lastName('male')
firstNames: faker.person.firstName('female'),
familyName: faker.person.lastName('female')
}

const childNameFormatted = formatName(childName)
Expand All @@ -41,7 +41,7 @@ test.describe.serial('Approval of late birth registration', () => {
await page.locator('#firstname').fill(childName.firstNames)
await page.locator('#surname').fill(childName.familyName)
await page.locator('#child____gender').click()
await page.getByText('Male', { exact: true }).click()
await page.getByText('Female', { exact: true }).click()

await page.getByPlaceholder('dd').fill('12')
await page.getByPlaceholder('mm').fill('05')
Expand Down Expand Up @@ -137,7 +137,6 @@ test.describe.serial('Approval of late birth registration', () => {
).toBeVisible()
})

// @TODO: This test should be added after action conditionals are implemented
test.skip('RA should not have the option to Approve', async () => {
await page.getByRole('button', { name: 'Action', exact: true }).click()
await expect(page.getByText('Approve', { exact: true })).not.toBeVisible()
Expand All @@ -151,6 +150,15 @@ test.describe.serial('Approval of late birth registration', () => {
await page.getByRole('button', { name: childNameFormatted }).click()
})

test('Unassign', async () => {
await page.getByRole('button', { name: 'Action', exact: true }).click()
await page.getByText('Unassign', { exact: true }).click()
await page.getByRole('button', { name: 'Unassign', exact: true }).click()
await expect(
page.getByText('Not assigned', { exact: true })
).toBeVisible()
})

test('Approve action should be disabled before assignment', async () => {
await page.getByRole('button', { name: 'Action', exact: true }).click()
const approveButton = page.getByText('Approve', { exact: true })
Expand Down Expand Up @@ -203,6 +211,11 @@ test.describe.serial('Approval of late birth registration', () => {
).not.toBeVisible()
})

test("Validate that the 'Approve' action is no longer available", async () => {
await page.getByRole('button', { name: 'Action', exact: true }).click()
await expect(page.getByText('Approve', { exact: true })).not.toBeVisible()
})

test('Validate that action and form field value appearing in audit trail', async () => {
await switchEventTab(page, 'Audit')
await page.getByRole('button', { name: 'Approved', exact: true }).click()
Expand All @@ -212,3 +225,130 @@ test.describe.serial('Approval of late birth registration', () => {
})
})
})

test.describe('Birth with non-late registration will not have flag or Approve-action available', () => {
let page: Page
const childName = {
firstNames: faker.person.firstName('female'),
familyName: faker.person.lastName('female')
}

const childNameFormatted = formatName(childName)

test.beforeAll(async ({ browser }) => {
page = await browser.newPage()
})

test.afterAll(async () => {
await page.close()
})

test.describe.serial('Declaration started by FA', async () => {
test.beforeAll(async () => {
await login(page, CREDENTIALS.FIELD_AGENT)
await page.click('#header-new-event')
await page.getByLabel('Birth').click()
await page.getByRole('button', { name: 'Continue' }).click()
await page.getByRole('button', { name: 'Continue' }).click()
})

test('Fill child details with birth date from over a year ago', async () => {
await page.locator('#firstname').fill(childName.firstNames)
await page.locator('#surname').fill(childName.familyName)
await page.locator('#child____gender').click()
await page.getByText('Female', { exact: true }).click()

await page.getByPlaceholder('dd').fill('12')
await page.getByPlaceholder('mm').fill('05')
await page.getByPlaceholder('yyyy').fill('2019')
await page.locator('#child____reason').fill('Late registration reason')

await page.locator('#child____placeOfBirth').click()
await page.getByText('Health Institution', { exact: true }).click()
await page
.locator('#child____birthLocation')
.fill('Golden Valley Rural Health Centre'.slice(0, 3))
await page.getByText('Golden Valley Rural Health Centre').click()

await continueForm(page)
})

test('Fill informant details', async () => {
await page.locator('#informant____relation').click()
await page.getByText('Mother', { exact: true }).click()

await page.locator('#informant____email').fill('[email protected]')

await continueForm(page)
})

test("Fill mother's details", async () => {
await page.locator('#firstname').fill(faker.person.firstName('female'))
await page.locator('#surname').fill(faker.person.lastName('female'))

await page.getByPlaceholder('dd').fill('25')
await page.getByPlaceholder('mm').fill('11')
await page.getByPlaceholder('yyyy').fill('2025')

await page.locator('#mother____idType').click()
await page.getByText('None', { exact: true }).click()

await continueForm(page)
})

test("Fill father's details", async () => {
await page.locator('#firstname').fill(faker.person.firstName('male'))
await page.locator('#surname').fill(faker.person.lastName('male'))

await page.getByPlaceholder('dd').fill('12')
await page.getByPlaceholder('mm').fill('05')
await page.getByPlaceholder('yyyy').fill('1985')

await page.locator('#father____idType').click()
await page.getByText('None', { exact: true }).click()

await page.locator('#father____nationality').click()
await page.getByText('Gabon', { exact: true }).click()

await page.locator('#father____addressSameAs_YES').click()

await page.getByRole('button', { name: 'Continue' }).click()
})

test('Go to review', async () => {
await goToSection(page, 'review')
})

test('Fill up informant comment & signature', async () => {
await page.locator('#review____comment').fill(faker.lorem.sentence())
await page.getByRole('button', { name: 'Sign', exact: true }).click()
await drawSignature(page, 'review____signature_canvas_element', false)
await page
.locator('#review____signature_modal')
.getByRole('button', { name: 'Apply' })
.click()
})

test('Send for review', async () => {
await page.getByRole('button', { name: 'Send for review' }).click()
await page.getByRole('button', { name: 'Confirm' }).click()
await ensureOutboxIsEmpty(page)
})

test('Navigate to the record', async () => {
await page.getByText('Sent for review').click()
await page.getByRole('button', { name: childNameFormatted }).click()
})

test("Record should not have the 'Approval required for late registration' -flag", async () => {
await expect(
page.getByText('Approval required for late registration')
).not.toBeVisible()
})

test('Record should not have the "Approve"-action available', async () => {
await page.getByRole('button', { name: 'Action', exact: true }).click()
await expect(page.getByText('Approve', { exact: true })).not.toBeVisible()
})
})
})
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"@hapi/hapi": "^20.0.1",
"@hapi/inert": "^6.0.3",
"@opencrvs/mosip": "1.9.0-beta.7",
"@opencrvs/toolkit": "1.9.0-rc.8476ac9",
"@opencrvs/toolkit": "1.9.0-rc.8a42cc8",
"@types/chalk": "^2.2.0",
"@types/code": "^4.0.3",
"@types/csv2json": "^1.4.0",
Expand Down
9 changes: 0 additions & 9 deletions src/form/tennis-club-membership.ts
Original file line number Diff line number Diff line change
Expand Up @@ -892,15 +892,6 @@ export const tennisClubMembershipEvent = defineConfig({
},
review: TENNIS_CLUB_DECLARATION_REVIEW
},
{
type: ActionType.DELETE,
label: {
defaultMessage: 'Delete draft',
description:
'This is shown as the action name anywhere the user can trigger the action from',
id: 'event.tennis-club-membership.action.delete.label'
}
},
{
type: ActionType.VALIDATE,
label: {
Expand Down
19 changes: 13 additions & 6 deletions src/form/v2/birth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
ConditionalType,
defineConfig,
field,
flag,
not
} from '@opencrvs/toolkit/events'
import {
Expand Down Expand Up @@ -228,12 +229,6 @@ export const birthEvent = defineConfig({
'This is shown as the action name anywhere the user can trigger the action from',
id: 'event.birth.action.approve.label'
},
supportingCopy: {
defaultMessage:
'This birth has been registered late. You are now approving it for further validation and registration.',
description: 'This is the confirmation text for the approve action',
id: 'event.birth.action.approve.confirmationText'
},
form: [
{
id: 'notes',
Expand All @@ -249,11 +244,23 @@ export const birthEvent = defineConfig({
flags: [
{ id: 'approval-required-for-late-registration', operation: 'remove' }
],
conditionals: [
{
type: ConditionalType.SHOW,
conditional: flag('approval-required-for-late-registration')
}
],
auditHistoryLabel: {
defaultMessage: 'Approved',
description:
'The label to show in audit history for the approve action',
id: 'event.birth.action.approve.audit-history-label'
},
supportingCopy: {
defaultMessage:
'This birth has been registered late. You are now approving it for further validation and registration.',
description: 'This is the confirmation text for the approve action',
id: 'event.birth.action.approve.confirmationText'
}
},
{
Expand Down
Loading
Loading