Skip to content

Commit 17d2fc6

Browse files
committed
test: test: test case for hidden input with matching label
1 parent 22a5962 commit 17d2fc6

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/rules/input-requires-label.spec.js

+12
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,18 @@ describe(`Rules: ${ruleId}`, () => {
2828
const messages = HTMLHint.verify(code, ruleOptions)
2929
expect(messages.length).to.be(0)
3030
})
31+
32+
it('Hidden input tag with matching label before should result in no error', () => {
33+
const code = '<label for="some-id"/><input id="some-id" type="hidden" />'
34+
const messages = HTMLHint.verify(code, ruleOptions)
35+
expect(messages.length).to.be(0)
36+
})
37+
38+
it('Hidden input tag with matching label after should result in no error', () => {
39+
const code = '<input id="some-id" type="hidden" /><label for="some-id"/>'
40+
const messages = HTMLHint.verify(code, ruleOptions)
41+
expect(messages.length).to.be(0)
42+
})
3143
})
3244

3345
describe('Error cases', () => {

0 commit comments

Comments
 (0)