0
0
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:
XhmikosR 2021-12-09 16:01:29 +02:00 committed by GitHub
parent 28a5a72ed5
commit 94d4fa3b10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 32 additions and 30 deletions

View File

@ -86,7 +86,7 @@ describe('EventHandler', () => {
'</div>',
'<div class="sibling"></div>',
'</div>'
]
].join('')
const outer = fixtureEl.querySelector('.outer')
const inner = fixtureEl.querySelector('.inner')

View File

@ -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'))

View File

@ -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')

View File

@ -722,7 +722,7 @@ describe('Tooltip', () => {
'<b>Trigger</b>',
'the tooltip',
'</a>'
]
].join('')
const tooltipEl = fixtureEl.querySelector('a')
const tooltip = new Tooltip(tooltipEl)

View File

@ -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')