mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-30 22:52:24 +01:00
Fix tests fixture type (#35501)
Previously we were adding an Array instead of a String
This commit is contained in:
parent
28a5a72ed5
commit
94d4fa3b10
@ -86,7 +86,7 @@ describe('EventHandler', () => {
|
||||
'</div>',
|
||||
'<div class="sibling"></div>',
|
||||
'</div>'
|
||||
]
|
||||
].join('')
|
||||
|
||||
const outer = fixtureEl.querySelector('.outer')
|
||||
const inner = fixtureEl.querySelector('.inner')
|
||||
|
@ -30,13 +30,15 @@ describe('SelectorEngine', () => {
|
||||
})
|
||||
|
||||
it('should handle :scope selectors', () => {
|
||||
fixtureEl.innerHTML = `<ul>
|
||||
<li></li>
|
||||
<li>
|
||||
<a href="#" class="active">link</a>
|
||||
</li>
|
||||
<li></li>
|
||||
</ul>`
|
||||
fixtureEl.innerHTML = [
|
||||
'<ul>',
|
||||
' <li></li>',
|
||||
' <li>',
|
||||
' <a href="#" class="active">link</a>',
|
||||
' </li>',
|
||||
' <li></li>',
|
||||
'</ul>'
|
||||
].join('')
|
||||
|
||||
const listEl = fixtureEl.querySelector('ul')
|
||||
const aActive = fixtureEl.querySelector('.active')
|
||||
@ -57,11 +59,13 @@ describe('SelectorEngine', () => {
|
||||
|
||||
describe('children', () => {
|
||||
it('should find children', () => {
|
||||
fixtureEl.innerHTML = `<ul>
|
||||
<li></li>
|
||||
<li></li>
|
||||
<li></li>
|
||||
</ul>`
|
||||
fixtureEl.innerHTML = [
|
||||
'<ul>',
|
||||
' <li></li>',
|
||||
' <li></li>',
|
||||
' <li></li>',
|
||||
'</ul>'
|
||||
].join('')
|
||||
|
||||
const list = fixtureEl.querySelector('ul')
|
||||
const liList = [].concat(...fixtureEl.querySelectorAll('li'))
|
||||
|
@ -1649,7 +1649,7 @@ describe('Dropdown', () => {
|
||||
' </div>',
|
||||
'</div>',
|
||||
'<input type="text">'
|
||||
]
|
||||
].join('')
|
||||
|
||||
const triggerDropdown = fixtureEl.querySelector('[data-bs-toggle="dropdown"]')
|
||||
const input = fixtureEl.querySelector('input')
|
||||
@ -1735,7 +1735,7 @@ describe('Dropdown', () => {
|
||||
' </div>',
|
||||
' </div>',
|
||||
'</div>'
|
||||
]
|
||||
].join('')
|
||||
|
||||
const triggerDropdown = fixtureEl.querySelector('[data-bs-toggle="dropdown"]')
|
||||
const dropdown = new Dropdown(triggerDropdown)
|
||||
@ -1767,7 +1767,7 @@ describe('Dropdown', () => {
|
||||
' </div>',
|
||||
' </div>',
|
||||
'</div>'
|
||||
]
|
||||
].join('')
|
||||
|
||||
const parent = fixtureEl.querySelector('.parent')
|
||||
const toggle = fixtureEl.querySelector('[data-bs-toggle="dropdown"]')
|
||||
@ -1826,7 +1826,7 @@ describe('Dropdown', () => {
|
||||
' <a class="dropdown-item" href="#">Dropdown item</a>',
|
||||
' </div>',
|
||||
'</div>'
|
||||
]
|
||||
].join('')
|
||||
|
||||
const dropdownToggle = fixtureEl.querySelector('[data-bs-toggle="dropdown"]')
|
||||
const dropdownMenu = fixtureEl.querySelector('.dropdown-menu')
|
||||
@ -1857,7 +1857,7 @@ describe('Dropdown', () => {
|
||||
' <a class="dropdown-item" href="#">Dropdown item</a>',
|
||||
' </div>',
|
||||
'</div>'
|
||||
]
|
||||
].join('')
|
||||
|
||||
const dropdownToggle = fixtureEl.querySelector('[data-bs-toggle="dropdown"]')
|
||||
const dropdownMenu = fixtureEl.querySelector('.dropdown-menu')
|
||||
@ -1888,7 +1888,7 @@ describe('Dropdown', () => {
|
||||
' <a class="dropdown-item" href="#">Dropdown item</a>',
|
||||
' </div>',
|
||||
'</div>'
|
||||
]
|
||||
].join('')
|
||||
|
||||
const dropdownToggle = fixtureEl.querySelector('[data-bs-toggle="dropdown"]')
|
||||
const dropdownMenu = fixtureEl.querySelector('.dropdown-menu')
|
||||
|
@ -722,7 +722,7 @@ describe('Tooltip', () => {
|
||||
'<b>Trigger</b>',
|
||||
'the tooltip',
|
||||
'</a>'
|
||||
]
|
||||
].join('')
|
||||
|
||||
const tooltipEl = fixtureEl.querySelector('a')
|
||||
const tooltip = new Tooltip(tooltipEl)
|
||||
|
@ -171,11 +171,10 @@ describe('Util', () => {
|
||||
|
||||
describe('isElement', () => {
|
||||
it('should detect if the parameter is an element or not and return Boolean', () => {
|
||||
fixtureEl.innerHTML =
|
||||
[
|
||||
'<div id="foo" class="test"></div>',
|
||||
'<div id="bar" class="test"></div>'
|
||||
].join('')
|
||||
fixtureEl.innerHTML = [
|
||||
'<div id="foo" class="test"></div>',
|
||||
'<div id="bar" class="test"></div>'
|
||||
].join('')
|
||||
|
||||
const el = fixtureEl.querySelector('#foo')
|
||||
|
||||
@ -199,11 +198,10 @@ describe('Util', () => {
|
||||
|
||||
describe('getElement', () => {
|
||||
it('should try to parse element', () => {
|
||||
fixtureEl.innerHTML =
|
||||
[
|
||||
'<div id="foo" class="test"></div>',
|
||||
'<div id="bar" class="test"></div>'
|
||||
].join('')
|
||||
fixtureEl.innerHTML = [
|
||||
'<div id="foo" class="test"></div>',
|
||||
'<div id="bar" class="test"></div>'
|
||||
].join('')
|
||||
|
||||
const el = fixtureEl.querySelector('div')
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user