From 4ef92b49ab70eacb913afa394209ac5a24522fad Mon Sep 17 00:00:00 2001 From: Radu Baston Date: Mon, 4 Nov 2024 17:20:27 +0200 Subject: [PATCH] [Tests] `jsx-no-script-url`: Improve tests --- CHANGELOG.md | 4 ++++ tests/lib/rules/jsx-no-script-url.js | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 94d723c668..638e053935 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,10 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange ### Fixed * [`no-danger`]: avoid a crash on a nested component name ([#3833][] @ljharb) +### Changed +* [Tests] [`jsx-no-script-url`]: Improve tests ([#3849][] @radu2147) + +[#3849]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3849 [#3833]: https://github.com/jsx-eslint/eslint-plugin-react/issues/3833 ## [7.37.2] - 2024.10.22 diff --git a/tests/lib/rules/jsx-no-script-url.js b/tests/lib/rules/jsx-no-script-url.js index 2a2ff394bd..b97c9ce567 100644 --- a/tests/lib/rules/jsx-no-script-url.js +++ b/tests/lib/rules/jsx-no-script-url.js @@ -38,6 +38,10 @@ ruleTester.run('jsx-no-script-url', rule, { { code: '' }, { code: '' }, { code: '' }, + { + code: '', + options: [[{ name: 'Foo', props: ['to', 'href'] }]], + }, { code: '', settings: { @@ -51,6 +55,13 @@ ruleTester.run('jsx-no-script-url', rule, { linkComponents: [{ name: 'Foo', linkAttribute: ['to', 'href'] }], }, }, + { + code: '', + options: [[], { includeFromSettings: true }], + settings: { + linkComponents: [{ name: 'Foo', linkAttribute: ['to', 'href'] }], + }, + }, ]), invalid: parsers.all([ // defaults