Skip to content

Commit

Permalink
Fix faling unit test after using humanName
Browse files Browse the repository at this point in the history
The expected name should match the format for the given country.

#6830
  • Loading branch information
Siyasanga committed Jan 15, 2025
1 parent 6f40ab8 commit 40966ab
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/client/src/i18n/messages/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,7 @@ const messagesToDefine: IConstantsMessages = {
id: 'constants.withinTargetDaysTo1Year'
},
humanName: {
defaultMessage: `{lastName} {middleName} {firstName}`,
defaultMessage: `{firstName} {middleName} {lastName}`,
description: 'A localized order of the full name',
id: 'constants.humanName'
}
Expand Down
10 changes: 5 additions & 5 deletions packages/client/src/utils/draftUtils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ describe('draftUtils tests', () => {
familyNameEng: 'Hoque'
}
},
event: Event.Birth,
event: EventType.Birth,
savedOn: 1558037863335,
modifiedOn: 1558037867987
},
intlEngish
)
).toBe('Hoque Mushraful')
).toBe('Mushraful Hoque')
})
it('Returns child English name properly even though localed is Bangla', () => {
expect(
Expand All @@ -77,7 +77,7 @@ describe('draftUtils tests', () => {
},
intlBangla
)
).toBe('Hoque Mushraful')
).toBe('Mushraful Hoque')
})
})
describe('Death event', () => {
Expand All @@ -93,7 +93,7 @@ describe('draftUtils tests', () => {
familyNameEng: 'Hoque'
}
},
event: Event.Death,
event: EventType.Death,
savedOn: 1558037863335,
modifiedOn: 1558037867987
},
Expand All @@ -120,7 +120,7 @@ describe('draftUtils tests', () => {
},
intlEngish
)
).toBe('Hoque Mushraful')
).toBe('Mushraful Hoque')
})
})
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ describe('In Progress tab', () => {
const EXPECTED_DATE_OF_REJECTION = formattedDuration(TIME_STAMP)

expect(data[0].id).toBe('e302f7c5-ad87-4117-91c1-35eaf2ea7be8')
expect(data[0].name).toBe('hoque anik')
expect(data[0].name).toBe('anik hoque')
expect(data[0].lastUpdated).toBe(EXPECTED_DATE_OF_REJECTION)
expect(data[0].event).toBe('Birth')
expect(data[0].actions).toBeDefined()
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/views/RecordAudit/RecordAudit.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ describe('Record audit summary for WorkQueue declarations', () => {
component.find({ 'data-testid': 'type-value' }).hostNodes().text()
).toBe('Birth')
expect(component.find('#content-name').hostNodes().text()).toBe(
'Al Hasan Shakib'
'Shakib Al Hasan'
)
expect(
component
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ describe('when in device of large viewport', () => {
).toBe('Government of the peoples republic of Bangladesh')
expect(
reviewSectionComponent.find('#review_header_subject').hostNodes().text()
).toBe('Birth Declaration for Doe John')
).toBe('Birth Declaration for John Doe')
})

it('typing additional comments input triggers onchange review form', async () => {
Expand Down

0 comments on commit 40966ab

Please sign in to comment.