From eed8cd7b72c4a3cbe80c678711fe289518f18387 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'] } + ] + }, + }, ]), });