Skip to content

Commit 921cfe9

Browse files
committed
[Tests] jsx-no-script-url: Improve tests
1 parent d1556a3 commit 921cfe9

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/lib/rules/jsx-no-script-url.js

+11
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ ruleTester.run('jsx-no-script-url', rule, {
3838
{ code: '<a href={"javascript:"}></a>' },
3939
{ code: '<Foo href="javascript:"></Foo>' },
4040
{ code: '<a href />' },
41+
{
42+
code: '<Foo other="javascript:"></Foo>',
43+
options: [[{ name: 'Foo', props: ['to', 'href'] }]],
44+
},
4145
{
4246
code: '<Foo href="javascript:"></Foo>',
4347
settings: {
@@ -51,6 +55,13 @@ ruleTester.run('jsx-no-script-url', rule, {
5155
linkComponents: [{ name: 'Foo', linkAttribute: ['to', 'href'] }],
5256
},
5357
},
58+
{
59+
code: '<Foo other="javascript:"></Foo>',
60+
options: [[], { includeFromSettings: true }],
61+
settings: {
62+
linkComponents: [{ name: 'Foo', linkAttribute: ['to', 'href'] }],
63+
},
64+
},
5465
]),
5566
invalid: parsers.all([
5667
// defaults

0 commit comments

Comments
 (0)