Skip to content

Commit

Permalink
fix: add radio test for coverage reason (#4037)
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahgm authored Jul 23, 2024
1 parent db4fa1d commit 281c3d0
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions packages/components/src/Radio/Radio.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -316,3 +316,25 @@ test('disabled prop and styles', () => {
`"group/radio relative flex items-center gap-[1ch] w-full"`
);
});

test('radio group can be horizontal', () => {
const ref = React.createRef<HTMLLabelElement>();
render(
<ThemeProvider theme={theme}>
<Radio.Group label="With Label" orientation="horizontal">
<Radio value="1" data-testid="radio-1" ref={ref} disabled>
Option 1
</Radio>
<Radio value="2" data-testid="radio-2">
Option 2
</Radio>
</Radio.Group>
</ThemeProvider>
);

const group = screen.getByTestId('group');

expect(group.className).toMatchInlineSnapshot(
`"flex items-start flex-row gap-[1.5ch]"`
);
});

0 comments on commit 281c3d0

Please sign in to comment.