Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding test cases for label tests #709

Merged
merged 1 commit into from
Jun 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions __tests__/src/rules/control-has-associated-label-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@ const alwaysValid = [
{ code: '<input type="datetime" />' },
{ code: '<input type="email" />' },
{ code: '<input type="file" />' },
{ code: '<input type="hidden" />' },
{ code: '<input type="hidden" name="bot-field"/>' },
{ code: '<input type="hidden" name="form-name" value="Contact Form"/>' },
{ code: '<input type="image" />' },
{ code: '<input type="month" />' },
{ code: '<input type="number" />' },
Expand All @@ -221,6 +224,8 @@ const alwaysValid = [
{ code: '<input type="submit" />' },
{ code: '<input type="tel" />' },
{ code: '<input type="text" />' },
{ code: '<label>Foo <input type="text" /></label>' },
{ code: '<input name={field.name} id="foo" type="text" value={field.value} disabled={isDisabled} onChange={changeText(field.onChange, field.name)} onBlur={field.onBlur} />' },
{ code: '<input type="time" />' },
{ code: '<input type="url" />' },
{ code: '<input type="week" />' },
Expand Down
1 change: 1 addition & 0 deletions __tests__/src/rules/label-has-associated-control-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ const bothValid = [
const alwaysValid = [
{ code: '<div />' },
{ code: '<CustomElement />' },
{ code: '<input type="hidden" />' },
];

const htmlForInvalid = [
Expand Down