mirror of
https://github.com/twbs/bootstrap.git
synced 2025-02-12 09:54:25 +01:00
Tests: Minor fixes (#35455)
This commit is contained in:
parent
385fea49e8
commit
d8999dd566
@ -1430,7 +1430,7 @@ describe('Carousel', () => {
|
|||||||
' <div class="carousel-item">item 3</div>',
|
' <div class="carousel-item">item 3</div>',
|
||||||
' </div>',
|
' </div>',
|
||||||
' <button class="carousel-control-prev" data-bs-target="#myCarousel" type="button" data-bs-slide="prev"></button>',
|
' <button class="carousel-control-prev" data-bs-target="#myCarousel" type="button" data-bs-slide="prev"></button>',
|
||||||
' <button id="next" class="carousel-control-next" data-bs-target="#myCarousel" type="button" data-bs-slide="next"></div>',
|
' <button id="next" class="carousel-control-next" data-bs-target="#myCarousel" type="button" data-bs-slide="next"></button>',
|
||||||
'</div>'
|
'</div>'
|
||||||
].join('')
|
].join('')
|
||||||
|
|
||||||
@ -1453,8 +1453,8 @@ describe('Carousel', () => {
|
|||||||
' <div id="item2" class="carousel-item">item 2</div>',
|
' <div id="item2" class="carousel-item">item 2</div>',
|
||||||
' <div class="carousel-item">item 3</div>',
|
' <div class="carousel-item">item 3</div>',
|
||||||
' </div>',
|
' </div>',
|
||||||
' <a class="carousel-control-prev" href="#myCarousel" role="button" data-bs-slide="prev"></button>',
|
' <a class="carousel-control-prev" href="#myCarousel" role="button" data-bs-slide="prev"></a>',
|
||||||
' <a id="next" class="carousel-control-next" href="#myCarousel" role="button" data-bs-slide="next"></div>',
|
' <a id="next" class="carousel-control-next" href="#myCarousel" role="button" data-bs-slide="next"></a>',
|
||||||
'</div>'
|
'</div>'
|
||||||
].join('')
|
].join('')
|
||||||
|
|
||||||
@ -1520,8 +1520,8 @@ describe('Carousel', () => {
|
|||||||
' <div id="item2" class="carousel-item">item 2</div>',
|
' <div id="item2" class="carousel-item">item 2</div>',
|
||||||
' <div class="carousel-item">item 3</div>',
|
' <div class="carousel-item">item 3</div>',
|
||||||
' </div>',
|
' </div>',
|
||||||
' <button class="carousel-control-prev" data-bs-target="#myCarousel" type="button" data-bs-slide="prev"></div>',
|
' <button class="carousel-control-prev" data-bs-target="#myCarousel" type="button" data-bs-slide="prev"></button>',
|
||||||
' <button id="next" class="carousel-control-next" data-bs-target="#myCarousel" type="button" data-bs-slide="next"></div>',
|
' <button id="next" class="carousel-control-next" data-bs-target="#myCarousel" type="button" data-bs-slide="next"></button>',
|
||||||
'</div>'
|
'</div>'
|
||||||
].join('')
|
].join('')
|
||||||
|
|
||||||
|
@ -277,8 +277,7 @@ describe('Modal', () => {
|
|||||||
fixtureEl.innerHTML = [
|
fixtureEl.innerHTML = [
|
||||||
'<button type="button" data-bs-dismiss="modal" data-bs-target="#modal1"></button>',
|
'<button type="button" data-bs-dismiss="modal" data-bs-target="#modal1"></button>',
|
||||||
'<div id="modal1" class="modal fade">',
|
'<div id="modal1" class="modal fade">',
|
||||||
' <div class="modal-dialog">',
|
' <div class="modal-dialog"></div>',
|
||||||
' </div>',
|
|
||||||
'</div>'
|
'</div>'
|
||||||
].join('')
|
].join('')
|
||||||
|
|
||||||
@ -303,8 +302,7 @@ describe('Modal', () => {
|
|||||||
it('should set .modal\'s scroll top to 0', done => {
|
it('should set .modal\'s scroll top to 0', done => {
|
||||||
fixtureEl.innerHTML = [
|
fixtureEl.innerHTML = [
|
||||||
'<div class="modal fade">',
|
'<div class="modal fade">',
|
||||||
' <div class="modal-dialog">',
|
' <div class="modal-dialog"></div>',
|
||||||
' </div>',
|
|
||||||
'</div>'
|
'</div>'
|
||||||
].join('')
|
].join('')
|
||||||
|
|
||||||
|
@ -114,7 +114,7 @@ describe('Tab', () => {
|
|||||||
fixtureEl.innerHTML = [
|
fixtureEl.innerHTML = [
|
||||||
'<nav class="nav">',
|
'<nav class="nav">',
|
||||||
' <button type="button" data-bs-target="#home" role="tab">Home</button>',
|
' <button type="button" data-bs-target="#home" role="tab">Home</button>',
|
||||||
' <button type="button" id="triggerProfile" data-bs-target="#profile" role="tab">Profile</a>',
|
' <button type="button" id="triggerProfile" data-bs-target="#profile" role="tab">Profile</button>',
|
||||||
'</nav>',
|
'</nav>',
|
||||||
'<div>',
|
'<div>',
|
||||||
' <div id="home" role="tabpanel"></div>',
|
' <div id="home" role="tabpanel"></div>',
|
||||||
|
@ -1112,7 +1112,8 @@ describe('Tooltip', () => {
|
|||||||
it('should do nothing if the content is a child of the element', () => {
|
it('should do nothing if the content is a child of the element', () => {
|
||||||
fixtureEl.innerHTML = [
|
fixtureEl.innerHTML = [
|
||||||
'<a href="#" rel="tooltip" title="Another tooltip">',
|
'<a href="#" rel="tooltip" title="Another tooltip">',
|
||||||
'<div id="childContent"></div>'
|
' <div id="childContent"></div>',
|
||||||
|
'</a>'
|
||||||
].join('')
|
].join('')
|
||||||
|
|
||||||
const tooltipEl = fixtureEl.querySelector('a')
|
const tooltipEl = fixtureEl.querySelector('a')
|
||||||
@ -1130,7 +1131,8 @@ describe('Tooltip', () => {
|
|||||||
it('should add the content as a child of the element for jQuery elements', () => {
|
it('should add the content as a child of the element for jQuery elements', () => {
|
||||||
fixtureEl.innerHTML = [
|
fixtureEl.innerHTML = [
|
||||||
'<a href="#" rel="tooltip" title="Another tooltip">',
|
'<a href="#" rel="tooltip" title="Another tooltip">',
|
||||||
'<div id="childContent"></div>'
|
' <div id="childContent"></div>',
|
||||||
|
'</a>'
|
||||||
].join('')
|
].join('')
|
||||||
|
|
||||||
const tooltipEl = fixtureEl.querySelector('a')
|
const tooltipEl = fixtureEl.querySelector('a')
|
||||||
@ -1147,7 +1149,8 @@ describe('Tooltip', () => {
|
|||||||
it('should add the child text content in the element', () => {
|
it('should add the child text content in the element', () => {
|
||||||
fixtureEl.innerHTML = [
|
fixtureEl.innerHTML = [
|
||||||
'<a href="#" rel="tooltip" title="Another tooltip">',
|
'<a href="#" rel="tooltip" title="Another tooltip">',
|
||||||
'<div id="childContent">Tooltip</div>'
|
' <div id="childContent">Tooltip</div>',
|
||||||
|
'</a>'
|
||||||
].join('')
|
].join('')
|
||||||
|
|
||||||
const tooltipEl = fixtureEl.querySelector('a')
|
const tooltipEl = fixtureEl.querySelector('a')
|
||||||
@ -1160,7 +1163,7 @@ describe('Tooltip', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('should add html without sanitize it', () => {
|
it('should add html without sanitize it', () => {
|
||||||
fixtureEl.innerHTML = '<a href="#" rel="tooltip" title="Another tooltip">'
|
fixtureEl.innerHTML = '<a href="#" rel="tooltip" title="Another tooltip"></a>'
|
||||||
|
|
||||||
const tooltipEl = fixtureEl.querySelector('a')
|
const tooltipEl = fixtureEl.querySelector('a')
|
||||||
const tooltip = new Tooltip(tooltipEl, {
|
const tooltip = new Tooltip(tooltipEl, {
|
||||||
@ -1174,7 +1177,7 @@ describe('Tooltip', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('should add html sanitized', () => {
|
it('should add html sanitized', () => {
|
||||||
fixtureEl.innerHTML = '<a href="#" rel="tooltip" title="Another tooltip">'
|
fixtureEl.innerHTML = '<a href="#" rel="tooltip" title="Another tooltip"></a>'
|
||||||
|
|
||||||
const tooltipEl = fixtureEl.querySelector('a')
|
const tooltipEl = fixtureEl.querySelector('a')
|
||||||
const tooltip = new Tooltip(tooltipEl, {
|
const tooltip = new Tooltip(tooltipEl, {
|
||||||
@ -1193,7 +1196,7 @@ describe('Tooltip', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('should add text content', () => {
|
it('should add text content', () => {
|
||||||
fixtureEl.innerHTML = '<a href="#" rel="tooltip" title="Another tooltip">'
|
fixtureEl.innerHTML = '<a href="#" rel="tooltip" title="Another tooltip"></a>'
|
||||||
|
|
||||||
const tooltipEl = fixtureEl.querySelector('a')
|
const tooltipEl = fixtureEl.querySelector('a')
|
||||||
const tooltip = new Tooltip(tooltipEl)
|
const tooltip = new Tooltip(tooltipEl)
|
||||||
@ -1206,7 +1209,7 @@ describe('Tooltip', () => {
|
|||||||
|
|
||||||
describe('_getTitle', () => {
|
describe('_getTitle', () => {
|
||||||
it('should return the title', () => {
|
it('should return the title', () => {
|
||||||
fixtureEl.innerHTML = '<a href="#" rel="tooltip" title="Another tooltip">'
|
fixtureEl.innerHTML = '<a href="#" rel="tooltip" title="Another tooltip"></a>'
|
||||||
|
|
||||||
const tooltipEl = fixtureEl.querySelector('a')
|
const tooltipEl = fixtureEl.querySelector('a')
|
||||||
const tooltip = new Tooltip(tooltipEl)
|
const tooltip = new Tooltip(tooltipEl)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user