Skip to content

Commit 3a5906d

Browse files
committed
add test
1 parent 9e6b3e8 commit 3a5906d

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/index.test.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,4 +650,17 @@ describe('rc-segmented', () => {
650650

651651
offsetParentSpy.mockRestore();
652652
});
653+
654+
it('all children should have a name property', () => {
655+
const GROUP_NAME = 'GROUP_NAME';
656+
const { container } = render(
657+
<Segmented options={['iOS', 'Android', 'Web']} name={GROUP_NAME} />,
658+
);
659+
660+
container
661+
.querySelectorAll<HTMLInputElement>('input[type="radio"]')
662+
.forEach((el) => {
663+
expect(el.name).toEqual(GROUP_NAME);
664+
});
665+
});
653666
});

0 commit comments

Comments
 (0)