aboutsummaryrefslogtreecommitdiff
path: root/js/tests/unit
diff options
context:
space:
mode:
authorCarson Sievert <[email protected]>2022-09-21 18:29:58 -0500
committerGitHub <[email protected]>2022-09-22 02:29:58 +0300
commit2b46842af908fe54bd7f7982ed07c7cd07bc934a (patch)
treeb03b1fe46bf710f544c5ae218d09b919c87eadb8 /js/tests/unit
parent27f20257ebd092b2e5d11a62de0cd5e9cf5a9949 (diff)
downloadbootstrap-2b46842af908fe54bd7f7982ed07c7cd07bc934a.tar.xz
bootstrap-2b46842af908fe54bd7f7982ed07c7cd07bc934a.zip
Fix active class toggling of tabs within dropdown (#37151)
* Close #36947: fix active class toggling tabs within dropdown
Diffstat (limited to 'js/tests/unit')
-rw-r--r--js/tests/unit/tab.spec.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/js/tests/unit/tab.spec.js b/js/tests/unit/tab.spec.js
index 15d581173..b00014eed 100644
--- a/js/tests/unit/tab.spec.js
+++ b/js/tests/unit/tab.spec.js
@@ -840,10 +840,11 @@ describe('Tab', () => {
'</ul>'
].join('')
- const firstDropItem = fixtureEl.querySelector('.dropdown-item')
+ const dropItems = fixtureEl.querySelectorAll('.dropdown-item')
- firstDropItem.click()
- expect(firstDropItem).toHaveClass('active')
+ dropItems[1].click()
+ expect(dropItems[0]).not.toHaveClass('active')
+ expect(dropItems[1]).toHaveClass('active')
expect(fixtureEl.querySelector('.nav-link')).not.toHaveClass('active')
})