From 96c1edef549a93d0419b8049af48ad9e924c5684 Mon Sep 17 00:00:00 2001 From: Bartosz Date: Mon, 8 Jan 2024 23:34:54 +0100 Subject: [PATCH] Tests --- tests/lib/rules/jsx-no-script-url.js | 40 ++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/tests/lib/rules/jsx-no-script-url.js b/tests/lib/rules/jsx-no-script-url.js index 24cff790a2..8bcba19e45 100644 --- a/tests/lib/rules/jsx-no-script-url.js +++ b/tests/lib/rules/jsx-no-script-url.js @@ -66,6 +66,24 @@ ruleTester.run('jsx-no-script-url', rule, { [{ name: 'Foo', props: ['to', 'href'] }], ], }, + { + code: '', + errors: [{ messageId: 'noScriptURL' }], + settings: { + linkComponents: [ + { name: 'Foo', linkAttributes: ['to'] } + ] + }, + }, + { + code: '', + errors: [{ messageId: 'noScriptURL' }], + settings: { + linkComponents: [ + { name: 'Foo', linkAttributes: ['to'] } + ] + }, + }, { code: `
@@ -84,5 +102,27 @@ ruleTester.run('jsx-no-script-url', rule, { ], ], }, + { + code: ` +
+ + +
+ `, + errors: [ + { messageId: 'noScriptURL' }, + { messageId: 'noScriptURL' }, + ], + options: [ + [ + { name: 'Bar', props: ['link'] }, + ], + ], + settings: { + linkComponents: [ + { name: 'Foo', linkAttributes: ['to', 'href'] } + ] + }, + }, ]), });