Skip to content

Commit

Permalink
Check for clearTimeout to have been called
Browse files Browse the repository at this point in the history
  • Loading branch information
rohit2sharma95 committed Jul 7, 2020
1 parent a48507b commit 616dc15
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions js/tests/unit/toast.spec.js
Expand Up @@ -186,12 +186,15 @@ describe('Toast', () => {
setTimeout(() => {
toast._config.autohide = false
toastEl.addEventListener('shown.bs.toast', () => {
expect(toast._clearTimeout).toHaveBeenCalled()
expect(toast._timeout).toBeNull()
done()
})
toast.show()
}, toast._config.delay / 2)

spyOn(toast, '_clearTimeout').and.callThrough()

toast.show()
})
})
Expand Down

0 comments on commit 616dc15

Please sign in to comment.