Skip to content

Commit 20e055a

Browse files
committed
Add label accessibility test
1 parent 38ea06f commit 20e055a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/TreeNode.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ describe('<TreeNode />', () => {
2424

2525
assert.isTrue(wrapper.find('.rct-node').exists());
2626
});
27+
28+
it('should render a label associated with a checkbox', () => {
29+
const wrapper = shallow(
30+
<TreeNode {...baseProps} treeId="planets" value="jupiter" />,
31+
);
32+
33+
assert.equal('planets-jupiter', wrapper.find('label').prop('htmlFor'));
34+
assert.equal('planets-jupiter', wrapper.find('label input[type="checkbox"]').prop('id'));
35+
});
2736
});
2837

2938
describe('label', () => {

0 commit comments

Comments
 (0)