From 4c290e5929a3511c17072522bc9aa16fa540c424 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20D=C3=A9ramond?= Date: Thu, 5 Oct 2023 11:42:54 +0200 Subject: [PATCH] Add unit test in selector-engine.spec.js --- js/tests/unit/dom/selector-engine.spec.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/js/tests/unit/dom/selector-engine.spec.js b/js/tests/unit/dom/selector-engine.spec.js index 72c0bf6db86f..95d9bf8ec9d8 100644 --- a/js/tests/unit/dom/selector-engine.spec.js +++ b/js/tests/unit/dom/selector-engine.spec.js @@ -371,6 +371,18 @@ describe('SelectorEngine', () => { expect(SelectorEngine.getMultipleElementsFromSelector(testEl)).toEqual(Array.from(fixtureEl.querySelectorAll('.target'))) }) + it('should get elements if several ids with special chars are given', () => { + fixtureEl.innerHTML = [ + '
', + '
', + '
' + ].join('') + + const testEl = fixtureEl.querySelector('#test') + + expect(SelectorEngine.getMultipleElementsFromSelector(testEl)).toEqual(Array.from(fixtureEl.querySelectorAll('.target'))) + }) + it('should get elements in array, from href if no data-bs-target set', () => { fixtureEl.innerHTML = [ '',