Skip to content

Commit b7c75c4

Browse files
authored
Merge pull request #76 from DouglasNeuroInformatics/test-ids
fix: add testid to destructive-action-dialog
2 parents 981b17d + a2bed6a commit b7c75c4

File tree

3 files changed

+9
-13
lines changed

3 files changed

+9
-13
lines changed

src/components/Form/BooleanField/BooleanFieldRadio.tsx

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,31 +49,25 @@ export const BooleanFieldRadio = ({
4949

5050
return (
5151
<FieldGroup name={name}>
52-
<Label>{label}</Label>
52+
<FieldGroup.Row>
53+
<Label>{label}</Label>
54+
<FieldGroup.Description description={description} />
55+
</FieldGroup.Row>
5356
<RadioGroup
5457
disabled={disabled || readOnly}
5558
name={name}
5659
value={stringifyBoolean(value)}
5760
onValueChange={handleValueChange}
5861
>
59-
<FieldGroup.Description description={description} />
6062
<FieldGroup.Row>
6163
<RadioGroup.Item id={`${name}-true`} value="true" />
62-
<Label
63-
aria-disabled={disabled || readOnly}
64-
className="text-muted-foreground font-normal"
65-
htmlFor={`${name}-true`}
66-
>
64+
<Label aria-disabled={disabled || readOnly} className="text-muted-foreground" htmlFor={`${name}-true`}>
6765
{options?.true ?? t('form.radioLabels.true')}
6866
</Label>
6967
</FieldGroup.Row>
7068
<FieldGroup.Row>
7169
<RadioGroup.Item id={`${name}-false`} value="false" />
72-
<Label
73-
aria-disabled={disabled || readOnly}
74-
className="text-muted-foreground font-normal"
75-
htmlFor={`${name}-false`}
76-
>
70+
<Label aria-disabled={disabled || readOnly} className="text-muted-foreground" htmlFor={`${name}-false`}>
7771
{options?.false ?? t('form.radioLabels.false')}
7872
</Label>
7973
</FieldGroup.Row>

src/components/Form/Form.stories.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,14 @@ type SimpleExampleFormSchemaType = typeof $SimpleExampleFormData;
5959

6060
const booleanFields: FormFields<Pick<ExampleFormData, 'booleanCheck' | 'booleanRadio'>> = {
6161
booleanRadio: {
62+
description: 'This is a boolean radio field',
6263
disabled: DISABLED,
6364
kind: 'boolean',
6465
label: 'Radio',
6566
variant: 'radio'
6667
},
6768
booleanCheck: {
69+
description: 'This is a boolean check field',
6870
disabled: DISABLED,
6971
kind: 'boolean',
7072
label: 'Checkbox',

src/providers/CoreProvider/DestructiveActionDialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export const DestructiveActionDialog = () => {
6969

7070
return (
7171
<Dialog open={current !== null} onOpenChange={handleOpenChange}>
72-
<Dialog.Content onOpenAutoFocus={(event) => event.preventDefault()}>
72+
<Dialog.Content data-testid="destructive-action-dialog" onOpenAutoFocus={(event) => event.preventDefault()}>
7373
<Dialog.Header>
7474
<Dialog.Title>{display.title}</Dialog.Title>
7575
<Dialog.Description>{display.description}</Dialog.Description>

0 commit comments

Comments
 (0)