Skip to content

Commit

Permalink
Add missing commit
Browse files Browse the repository at this point in the history
  • Loading branch information
julien-deramond committed Feb 19, 2024
1 parent 923ed80 commit ccab0d6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions js/tests/unit/dom/selector-engine.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
'<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>',
Expand Down

0 comments on commit ccab0d6

Please sign in to comment.