From 2cbb0a941c0a33fc11518061cfd6fad5c0d1c3c0 Mon Sep 17 00:00:00 2001 From: Carson Sievert Date: Wed, 21 Apr 2021 00:30:19 -0500 Subject: Dropdown: support `.dropdown-item` wrapped in `
  • ` tags (#33634) Co-authored-by: XhmikosR --- js/tests/unit/tab.spec.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'js/tests') diff --git a/js/tests/unit/tab.spec.js b/js/tests/unit/tab.spec.js index 4741b495d..c8e1475ad 100644 --- a/js/tests/unit/tab.spec.js +++ b/js/tests/unit/tab.spec.js @@ -515,6 +515,28 @@ describe('Tab', () => { expect(fixtureEl.querySelector('#nav2 .dropdown-item').classList.contains('active')).toEqual(false) }) + it('should support li > .dropdown-item', () => { + fixtureEl.innerHTML = [ + '' + ].join('') + + const firstDropItem = fixtureEl.querySelector('.dropdown-item') + + firstDropItem.click() + expect(firstDropItem.classList.contains('active')).toEqual(true) + expect(fixtureEl.querySelector('.nav-link').classList.contains('active')).toEqual(false) + }) + it('should handle nested tabs', done => { fixtureEl.innerHTML = [ '