mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-13 00:54:04 +02:00
Remove potential false positive assertions (#33288)
* Remove potential false positive assertions querySelector() returns null but expect(document.querySelector('...')).toBeDefined() tests that the value is not undefined * Migrated assertions from .toBeDefined() to .not.toBeNull() for .getInstance() calls in tests * Migrate offcanvas assertions from .toBeDefined() to .not.toBeNull() for .getInstance() call * convert more cases to not.toBeNull assertions Co-authored-by: XhmikosR <xhmikosr@gmail.com>
This commit is contained in:
committed by
GitHub
parent
9c3ab6557e
commit
052def4568
@@ -472,7 +472,7 @@ describe('Toast', () => {
|
||||
|
||||
const toast = new Toast(toastEl)
|
||||
|
||||
expect(Toast.getInstance(toastEl)).toBeDefined()
|
||||
expect(Toast.getInstance(toastEl)).not.toBeNull()
|
||||
expect(toastEl.addEventListener).toHaveBeenCalledWith('click', jasmine.any(Function), jasmine.any(Boolean))
|
||||
|
||||
toast.dispose()
|
||||
@@ -494,7 +494,7 @@ describe('Toast', () => {
|
||||
const toast = new Toast(toastEl)
|
||||
const expected = () => {
|
||||
expect(toastEl.classList.contains('show')).toEqual(true)
|
||||
expect(Toast.getInstance(toastEl)).toBeDefined()
|
||||
expect(Toast.getInstance(toastEl)).not.toBeNull()
|
||||
|
||||
toast.dispose()
|
||||
|
||||
@@ -523,7 +523,7 @@ describe('Toast', () => {
|
||||
|
||||
jQueryMock.fn.toast.call(jQueryMock)
|
||||
|
||||
expect(Toast.getInstance(div)).toBeDefined()
|
||||
expect(Toast.getInstance(div)).not.toBeNull()
|
||||
})
|
||||
|
||||
it('should not re create a toast', () => {
|
||||
|
Reference in New Issue
Block a user