Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/js/tests
diff options
context:
space:
mode:
authorGeoSot <geo.sotis@gmail.com>2022-02-01 11:33:18 +0300
committerGitHub <noreply@github.com>2022-02-01 11:33:18 +0300
commit3f7b31e0e021ad45943c565a02509b4c10e55091 (patch)
treef5f3c50cf6a086554b9e064f56a456cb612fb1a7 /js/tests
parentc44d99f55c0e1dcc5a23a9f420972bfccfcddb13 (diff)
Fix Popover test that randomly fails on BrowserStack (#35757)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
Diffstat (limited to 'js/tests')
-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 7bbd52b1db..bf3a71848c 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', () => {