Skip to content

Commit 00bd6d8

Browse files
committed
Add failing test for autocomplete with dynamic type
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.
1 parent 7a34e45 commit 00bd6d8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

__tests__/src/rules/autocomplete-valid-test.js

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ ruleTester.run('autocomplete-valid', rule, {
5454
{ code: '<input type="text" autocomplete="invalid name" />;', errors: invalidAutocomplete },
5555
{ code: '<input type="text" autocomplete="home url" />;', errors: invalidAutocomplete },
5656
{ code: '<Bar autocomplete="baz"></Bar>;', errors: invalidAutocomplete, options: [{ inputComponents: ['Bar'] }] },
57+
{ code: '<input type={isEmail ? "email" : "text"} autocomplete="none" />;', errors: invalidAutocomplete },
5758

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

0 commit comments

Comments
 (0)