diff options
author | Ben Lertlumprasertkul <benlertlumprasertkul@gmail.com> | 2021-05-11 08:45:57 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-11 08:45:57 +0300 |
commit | 052def456845c2147e4e6c99d17bba12fcbee34c (patch) | |
tree | 9f23d9f09941c43fd519bde2498da808a8764635 /js/tests/README.md | |
parent | 9c3ab6557ec89ae11cc27da1b4680b3e69381edf (diff) |
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>
Diffstat (limited to 'js/tests/README.md')
-rw-r--r-- | js/tests/README.md | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/js/tests/README.md b/js/tests/README.md index f614499b49..1e96a6b5da 100644 --- a/js/tests/README.md +++ b/js/tests/README.md @@ -61,7 +61,7 @@ it('should show a tooltip without the animation', done => { tooltipEl.addEventListener('shown.bs.tooltip', () => { const tip = document.querySelector('.tooltip') - expect(tip).toBeDefined() + expect(tip).not.toBeNull() expect(tip.classList.contains('fade')).toEqual(false) done() }) |