1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-10 23:54:08 +02:00

tests: revisit all tests using Promise.reject instead of throwing an error (#35765)

This commit is contained in:
GeoSot
2022-02-19 16:08:16 +02:00
committed by GitHub
parent ae12d645ef
commit 4b17868fb4
10 changed files with 72 additions and 72 deletions

View File

@@ -329,7 +329,7 @@ describe('Offcanvas', () => {
})
it('should not fire shown when show is prevented', () => {
return new Promise(resolve => {
return new Promise((resolve, reject) => {
fixtureEl.innerHTML = '<div class="offcanvas"></div>'
const offCanvasEl = fixtureEl.querySelector('div')
@@ -349,7 +349,7 @@ describe('Offcanvas', () => {
})
offCanvasEl.addEventListener('shown.bs.offcanvas', () => {
throw new Error('should not fire shown event')
reject(new Error('should not fire shown event'))
})
offCanvas.show()
@@ -455,7 +455,7 @@ describe('Offcanvas', () => {
})
it('should not fire hidden when hide is prevented', () => {
return new Promise(resolve => {
return new Promise((resolve, reject) => {
fixtureEl.innerHTML = '<div class="offcanvas"></div>'
const offCanvasEl = fixtureEl.querySelector('div')
@@ -477,7 +477,7 @@ describe('Offcanvas', () => {
})
offCanvasEl.addEventListener('hidden.bs.offcanvas', () => {
throw new Error('should not fire hidden event')
reject(new Error('should not fire hidden event'))
})
offCanvas.hide()