File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed
packages/client/src/v2-events/features/events/registered-fields Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -131,6 +131,9 @@ export const UncheckedCheckboxShouldNotAppearOnReview: StoryObj<
131131
132132 await canvas . findByText ( / C h e c k b o x r e v i e w ? / )
133133
134- await expect ( canvas . queryByTestId ( 'No recommender' ) ) . not . toBeInTheDocument ( )
134+ await expect ( await canvas . findByText ( 'No recommender' ) ) . toBeInTheDocument ( )
135+ await expect (
136+ ( await canvas . findByTestId ( 'row-value-recommender.none' ) ) . textContent
137+ ) . toEqual ( 'No' )
135138 }
136139}
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import React from 'react'
1212import { useIntl } from 'react-intl'
1313import { Checkbox as CheckboxComponent } from '@opencrvs/components'
1414import { FieldPropsWithoutReferenceValue } from '@opencrvs/commons/client'
15+ import { buttonMessages } from '@client/i18n/messages'
1516
1617function CheckboxInput ( {
1718 label,
@@ -48,14 +49,10 @@ function CheckboxOutput({
4849 value ?: boolean
4950 required ?: boolean
5051} ) {
51- // If a checkbox is required, we always show it
52- if ( required ) {
53- // We explicity check for boolean true, so that e.g. string values are not interpreted as true.
54- return value === true ? 'Yes' : 'No'
55- }
56-
57- // If a checkbox is not required, we only show it if it is true
58- return value === true ? 'Yes' : null
52+ const intl = useIntl ( )
53+ return value === true
54+ ? intl . formatMessage ( buttonMessages . yes )
55+ : intl . formatMessage ( buttonMessages . no )
5956}
6057
6158export const Checkbox = {
You can’t perform that action at this time.
0 commit comments