Skip to content

Commit

Permalink
[Tests] jsx-no-script-url: Improve tests
Browse files Browse the repository at this point in the history
  • Loading branch information
radu2147 committed Nov 4, 2024
1 parent d1556a3 commit 921cfe9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/lib/rules/jsx-no-script-url.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ ruleTester.run('jsx-no-script-url', rule, {
{ code: '<a href={"javascript:"}></a>' },
{ code: '<Foo href="javascript:"></Foo>' },
{ code: '<a href />' },
{
code: '<Foo other="javascript:"></Foo>',
options: [[{ name: 'Foo', props: ['to', 'href'] }]],
},
{
code: '<Foo href="javascript:"></Foo>',
settings: {
Expand All @@ -51,6 +55,13 @@ ruleTester.run('jsx-no-script-url', rule, {
linkComponents: [{ name: 'Foo', linkAttribute: ['to', 'href'] }],
},
},
{
code: '<Foo other="javascript:"></Foo>',
options: [[], { includeFromSettings: true }],
settings: {
linkComponents: [{ name: 'Foo', linkAttribute: ['to', 'href'] }],
},
},
]),
invalid: parsers.all([
// defaults
Expand Down

0 comments on commit 921cfe9

Please sign in to comment.