Skip to content

Commit

Permalink
Add failing test for autocomplete with dynamic type
Browse files Browse the repository at this point in the history
This will cause axe to throw an error like:

> TypeError: Cannot read property 'replace' of null

I believe that the problem might be related to getLiteralPropValue
returning `null` instead of `undefined` for dynamic props.
  • Loading branch information
lencioni committed Jun 30, 2020
1 parent 7a34e45 commit 00bd6d8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions __tests__/src/rules/autocomplete-valid-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ ruleTester.run('autocomplete-valid', rule, {
{ code: '<input type="text" autocomplete="invalid name" />;', errors: invalidAutocomplete },
{ code: '<input type="text" autocomplete="home url" />;', errors: invalidAutocomplete },
{ code: '<Bar autocomplete="baz"></Bar>;', errors: invalidAutocomplete, options: [{ inputComponents: ['Bar'] }] },
{ code: '<input type={isEmail ? "email" : "text"} autocomplete="none" />;', errors: invalidAutocomplete },

// FAILED "autocomplete-appropriate"
{ code: '<input type="date" autocomplete="email" />;', errors: inappropriateAutocomplete },
Expand Down

0 comments on commit 00bd6d8

Please sign in to comment.