1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-14 01:24:19 +02:00

Dropdown: Merge display='static' & isNavbar functionality activating static popper with no styles attached

This commit is contained in:
GeoSot
2021-10-10 15:09:57 +03:00
committed by XhmikosR
parent 137b324930
commit fb5921dec4
2 changed files with 10 additions and 19 deletions

View File

@@ -1054,7 +1054,7 @@ describe('Dropdown', () => {
btnDropdown.click()
})
it('should not use Popper in navbar', done => {
it('should not use "static" Popper in navbar', done => {
fixtureEl.innerHTML = [
'<nav class="navbar navbar-expand-md navbar-light bg-light">',
' <div class="dropdown">',
@@ -1071,8 +1071,8 @@ describe('Dropdown', () => {
const dropdown = new Dropdown(btnDropdown)
btnDropdown.addEventListener('shown.bs.dropdown', () => {
expect(dropdown._popper).toBeNull()
expect(dropdownMenu.getAttribute('style')).toBeNull()
expect(dropdown._popper).not.toBeNull()
expect(dropdownMenu.getAttribute('data-bs-popper')).toEqual('static')
done()
})
@@ -1120,7 +1120,7 @@ describe('Dropdown', () => {
dropdown.show()
})
it('should manage bs attribute `data-bs-popper`="none" when dropdown is in navbar', done => {
it('should manage bs attribute `data-bs-popper`="static" when dropdown is in navbar', done => {
fixtureEl.innerHTML = [
'<nav class="navbar navbar-expand-md navbar-light bg-light">',
' <div class="dropdown">',
@@ -1137,7 +1137,7 @@ describe('Dropdown', () => {
const dropdown = new Dropdown(btnDropdown)
btnDropdown.addEventListener('shown.bs.dropdown', () => {
expect(dropdownMenu.getAttribute('data-bs-popper')).toEqual('none')
expect(dropdownMenu.getAttribute('data-bs-popper')).toEqual('static')
dropdown.hide()
})