Skip to content

Commit 5cbb718

Browse files
committedJun 21, 2020
Adding test cases for label tests
1 parent 1614b85 commit 5cbb718

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed
 

‎__tests__/src/rules/control-has-associated-label-test.js

+5
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,9 @@ const alwaysValid = [
210210
{ code: '<input type="datetime" />' },
211211
{ code: '<input type="email" />' },
212212
{ code: '<input type="file" />' },
213+
{ code: '<input type="hidden" />' },
214+
{ code: '<input type="hidden" name="bot-field"/>' },
215+
{ code: '<input type="hidden" name="form-name" value="Contact Form"/>' },
213216
{ code: '<input type="image" />' },
214217
{ code: '<input type="month" />' },
215218
{ code: '<input type="number" />' },
@@ -221,6 +224,8 @@ const alwaysValid = [
221224
{ code: '<input type="submit" />' },
222225
{ code: '<input type="tel" />' },
223226
{ code: '<input type="text" />' },
227+
{ code: '<label>Foo <input type="text" /></label>' },
228+
{ code: '<input name={field.name} id="foo" type="text" value={field.value} disabled={isDisabled} onChange={changeText(field.onChange, field.name)} onBlur={field.onBlur} />' },
224229
{ code: '<input type="time" />' },
225230
{ code: '<input type="url" />' },
226231
{ code: '<input type="week" />' },

‎__tests__/src/rules/label-has-associated-control-test.js

+1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ const bothValid = [
7070
const alwaysValid = [
7171
{ code: '<div />' },
7272
{ code: '<CustomElement />' },
73+
{ code: '<input type="hidden" />' },
7374
];
7475

7576
const htmlForInvalid = [

0 commit comments

Comments
 (0)
Please sign in to comment.