1
0
Fork 0
mirror of https://github.com/twbs/bootstrap.git synced 2022-11-09 12:25:43 -05:00

rewrite dropdown unit tests

This commit is contained in:
Johann-S 2019-04-10 10:46:50 +02:00
parent 0ed1618c06
commit 6a59c58480
7 changed files with 1508 additions and 1514 deletions

View file

@ -36,7 +36,7 @@ const bsPlugins = {
Button: path.resolve(__dirname, '../js/src/button/button.js'),
Carousel: path.resolve(__dirname, '../js/src/carousel/carousel.js'),
Collapse: path.resolve(__dirname, '../js/src/collapse/collapse.js'),
Dropdown: path.resolve(__dirname, '../js/src/dropdown.js'),
Dropdown: path.resolve(__dirname, '../js/src/dropdown/dropdown.js'),
Modal: path.resolve(__dirname, '../js/src/modal.js'),
Popover: path.resolve(__dirname, '../js/src/popover.js'),
ScrollSpy: path.resolve(__dirname, '../js/src/scrollspy.js'),

View file

@ -9,7 +9,7 @@ import Alert from './src/alert/alert'
import Button from './src/button/button'
import Carousel from './src/carousel/carousel'
import Collapse from './src/collapse/collapse'
import Dropdown from './src/dropdown'
import Dropdown from './src/dropdown/dropdown'
import Modal from './src/modal'
import Popover from './src/popover'
import ScrollSpy from './src/scrollspy'

View file

@ -9,7 +9,7 @@ import Alert from './src/alert/alert'
import Button from './src/button/button'
import Carousel from './src/carousel/carousel'
import Collapse from './src/collapse/collapse'
import Dropdown from './src/dropdown'
import Dropdown from './src/dropdown/dropdown'
import Modal from './src/modal'
import Popover from './src/popover'
import ScrollSpy from './src/scrollspy'

View file

@ -12,12 +12,12 @@ import {
makeArray,
noop,
typeCheckConfig
} from './util/index'
import Data from './dom/data'
import EventHandler from './dom/event-handler'
import Manipulator from './dom/manipulator'
} from '../util/index'
import Data from '../dom/data'
import EventHandler from '../dom/event-handler'
import Manipulator from '../dom/manipulator'
import Popper from 'popper.js'
import SelectorEngine from './dom/selector-engine'
import SelectorEngine from '../dom/selector-engine'
/**
* ------------------------------------------------------------------------
@ -289,15 +289,9 @@ class Dropdown {
}
_getMenuElement() {
if (!this._menu) {
const parent = Dropdown._getParentFromElement(this._element)
const parent = Dropdown._getParentFromElement(this._element)
if (parent) {
this._menu = SelectorEngine.findOne(Selector.MENU, parent)
}
}
return this._menu
return SelectorEngine.findOne(Selector.MENU, parent)
}
_getPlacement() {
@ -545,7 +539,7 @@ EventHandler
* ------------------------------------------------------------------------
* add .dropdown to jQuery only if jQuery is present
*/
/* istanbul ignore if */
if (typeof $ !== 'undefined') {
const JQUERY_NO_CONFLICT = $.fn[NAME]
$.fn[NAME] = Dropdown._jQueryInterface

File diff suppressed because it is too large Load diff

View file

@ -9,6 +9,7 @@ const {
} = require('./browsers')
const babel = require('rollup-plugin-babel')
const istanbul = require('rollup-plugin-istanbul')
const resolve = require('rollup-plugin-node-resolve')
const { env } = process
const browserStack = env.BROWSER === 'true'
@ -65,7 +66,8 @@ const rollupPreprocessor = {
plugins: [
'@babel/plugin-proposal-object-rest-spread'
]
})
}),
resolve()
],
output: {
format: 'iife',

File diff suppressed because it is too large Load diff