aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorGeoSot <[email protected]>2022-02-01 10:33:18 +0200
committerGitHub <[email protected]>2022-02-01 10:33:18 +0200
commit3f7b31e0e021ad45943c565a02509b4c10e55091 (patch)
treef5f3c50cf6a086554b9e064f56a456cb612fb1a7 /js
parentc44d99f55c0e1dcc5a23a9f420972bfccfcddb13 (diff)
downloadbootstrap-3f7b31e0e021ad45943c565a02509b4c10e55091.tar.xz
bootstrap-3f7b31e0e021ad45943c565a02509b4c10e55091.zip
Fix Popover test that randomly fails on BrowserStack (#35757)
Co-authored-by: XhmikosR <[email protected]>
Diffstat (limited to 'js')
-rw-r--r--js/tests/unit/popover.spec.js19
1 files changed, 7 insertions, 12 deletions
diff --git a/js/tests/unit/popover.spec.js b/js/tests/unit/popover.spec.js
index 7bbd52b1d..bf3a71848 100644
--- a/js/tests/unit/popover.spec.js
+++ b/js/tests/unit/popover.spec.js
@@ -166,21 +166,16 @@ describe('Popover', () => {
})
it('should NOT show a popover without `title` and `content`', () => {
- return new Promise(resolve => {
- fixtureEl.innerHTML = '<a href="#" data-bs-content="" title="">Nice link</a>'
+ fixtureEl.innerHTML = '<a href="#" data-bs-content="" title="">Nice link</a>'
- const popoverEl = fixtureEl.querySelector('a')
- const popover = new Popover(popoverEl, { animation: false })
- spyOn(EventHandler, 'trigger').and.callThrough()
+ const popoverEl = fixtureEl.querySelector('a')
+ const popover = new Popover(popoverEl, { animation: false })
+ spyOn(EventHandler, 'trigger').and.callThrough()
- setTimeout(() => {
- expect(EventHandler.trigger).not.toHaveBeenCalled()
- expect(document.querySelector('.popover')).toBeNull()
- resolve()
- })
+ popover.show()
- popover.show()
- })
+ expect(EventHandler.trigger).not.toHaveBeenCalledWith(popoverEl, Popover.Event.SHOW)
+ expect(document.querySelector('.popover')).toBeNull()
})
it('"setContent" should keep the initial template', () => {