From 43b4252a3487e419455f794e16d402a32d1ebe22 Mon Sep 17 00:00:00 2001 From: Hiws Date: Thu, 24 Sep 2020 13:55:38 +0200 Subject: fix tooltip hide method when already hidden (#31115) Co-authored-by: XhmikosR --- js/tests/unit/tooltip.spec.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'js/tests/unit/tooltip.spec.js') diff --git a/js/tests/unit/tooltip.spec.js b/js/tests/unit/tooltip.spec.js index 0a98096a4..3e5c91794 100644 --- a/js/tests/unit/tooltip.spec.js +++ b/js/tests/unit/tooltip.spec.js @@ -717,6 +717,20 @@ describe('Tooltip', () => { tooltip.show() }) + + it('should not throw error running hide if popper hasn\'t been shown', () => { + fixtureEl.innerHTML = '
' + + const div = fixtureEl.querySelector('div') + const tooltip = new Tooltip(div) + + try { + tooltip.hide() + expect().nothing() + } catch { + throw new Error('should not throw error') + } + }) }) describe('update', () => { -- cgit v1.2.3