-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
isPropValid: Add custom props to blacklist (#15)
* isPropValid: Add custom props to blacklist This update adjusts the `isPropValid` function to add a custom black list, starting with the prop `action`. In HSDS: React development, we noticed that the prop `action` leaked through. * Improve regex for OTHER_ATTRIBUTE_REGEX
- Loading branch information
Jon Quach
authored
Feb 28, 2019
1 parent
f413d40
commit 8742237
Showing
2 changed files
with
18 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import isPropValid from '../isPropValid' | ||
|
||
test('Filters out other stray props', () => { | ||
const props = ['action'] | ||
|
||
props.forEach(prop => { | ||
expect(isPropValid(prop)).toBeFalsy() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters