diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-07-24 09:22:02 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-07-24 09:22:02 +0000 |
commit | 8b9e5144f7af3bb0578d80ed619dd0743d0d5f0f (patch) | |
tree | c651acc917541c3ad4fc91eb30df52c2f07095fd /js/tests/unit/dom | |
parent | Adding upstream version 5.3.1+dfsg. (diff) | |
download | bootstrap-html-upstream.tar.xz bootstrap-html-upstream.zip |
Adding upstream version 5.3.3+dfsg.upstream/5.3.3+dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | js/tests/unit/dom/selector-engine.spec.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/js/tests/unit/dom/selector-engine.spec.js b/js/tests/unit/dom/selector-engine.spec.js index 8dd7b1f..95d9bf8 100644 --- a/js/tests/unit/dom/selector-engine.spec.js +++ b/js/tests/unit/dom/selector-engine.spec.js @@ -359,6 +359,30 @@ describe('SelectorEngine', () => { expect(SelectorEngine.getMultipleElementsFromSelector(testEl)).toEqual(Array.from(fixtureEl.querySelectorAll('.target'))) }) + it('should get elements if several ids are given', () => { + fixtureEl.innerHTML = [ + '<div id="test" data-bs-target="#target1,#target2"></div>', + '<div class="target" id="target1"></div>', + '<div class="target" id="target2"></div>' + ].join('') + + const testEl = fixtureEl.querySelector('#test') + + expect(SelectorEngine.getMultipleElementsFromSelector(testEl)).toEqual(Array.from(fixtureEl.querySelectorAll('.target'))) + }) + + it('should get elements if several ids with special chars are given', () => { + fixtureEl.innerHTML = [ + '<div id="test" data-bs-target="#j_id11:exampleModal,#j_id22:exampleModal"></div>', + '<div class="target" id="j_id11:exampleModal"></div>', + '<div class="target" id="j_id22:exampleModal"></div>' + ].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 = [ '<a id="test" href=".target"></a>', |