Skip to content

Commit

Permalink
test: add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
aojunhao123 committed Nov 27, 2024
1 parent 913982b commit 6817d51
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -753,4 +753,16 @@ describe('Segmented keyboard navigation', () => {
await user.keyboard('{ArrowLeft}');
expect(onChange).toHaveBeenCalledWith('iOS');
});

it('should not have focus style when clicking', async () => {
const user = userEvent.setup();
const { container } = render(
<Segmented options={['iOS', 'Android', 'Web']} />,
);

await user.click(container.querySelector('.rc-segmented-item-input')!);
expect(container.querySelector('.rc-segmented-item-input')).not.toHaveClass(
'rc-segmented-item-input-focused',
);
});
});

0 comments on commit 6817d51

Please sign in to comment.