mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-06-17 19:21:23 +03:00
change jQuery tests
This commit is contained in:
@@ -12,11 +12,25 @@ import ScrollSpy from '../../src/scrollspy'
|
|||||||
import Tab from '../../src/tab'
|
import Tab from '../../src/tab'
|
||||||
import Toast from '../../src/toast'
|
import Toast from '../../src/toast'
|
||||||
import Tooltip from '../../src/tooltip'
|
import Tooltip from '../../src/tooltip'
|
||||||
import { getFixture, clearFixture } from '../helpers/fixture'
|
import { clearFixture, getFixture } from '../helpers/fixture'
|
||||||
import { getJqueryInterfaceForPlugin } from '../../src/util/jquery-stuff'
|
import { getJqueryInterfaceForPlugin } from '../../src/util/jquery-stuff'
|
||||||
|
|
||||||
describe('jQuery', () => {
|
describe('jQuery', () => {
|
||||||
let fixtureEl
|
let fixtureEl
|
||||||
|
const plugins = [
|
||||||
|
Alert,
|
||||||
|
Button,
|
||||||
|
Carousel,
|
||||||
|
Collapse,
|
||||||
|
Dropdown,
|
||||||
|
Modal,
|
||||||
|
Offcanvas,
|
||||||
|
Popover,
|
||||||
|
ScrollSpy,
|
||||||
|
Tab,
|
||||||
|
Toast,
|
||||||
|
Tooltip
|
||||||
|
]
|
||||||
|
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
fixtureEl = getFixture()
|
fixtureEl = getFixture()
|
||||||
@@ -27,18 +41,22 @@ describe('jQuery', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('should add all plugins in jQuery', () => {
|
it('should add all plugins in jQuery', () => {
|
||||||
expect(getJqueryInterfaceForPlugin(Alert)).toEqual(jQuery.fn.alert)
|
for (const plugin of plugins) {
|
||||||
expect(getJqueryInterfaceForPlugin(Button)).toEqual(jQuery.fn.button)
|
getJqueryInterfaceForPlugin(plugin)
|
||||||
expect(getJqueryInterfaceForPlugin(Carousel)).toEqual(jQuery.fn.carousel)
|
}
|
||||||
expect(getJqueryInterfaceForPlugin(Collapse)).toEqual(jQuery.fn.collapse)
|
|
||||||
expect(getJqueryInterfaceForPlugin(Dropdown)).toEqual(jQuery.fn.dropdown)
|
expect(jQuery.fn.alert).toBeDefined()
|
||||||
expect(getJqueryInterfaceForPlugin(Modal)).toEqual(jQuery.fn.modal)
|
expect(jQuery.fn.button).toBeDefined()
|
||||||
expect(getJqueryInterfaceForPlugin(Offcanvas)).toEqual(jQuery.fn.offcanvas)
|
expect(jQuery.fn.carousel).toBeDefined()
|
||||||
expect(getJqueryInterfaceForPlugin(Popover)).toEqual(jQuery.fn.popover)
|
expect(jQuery.fn.collapse).toBeDefined()
|
||||||
expect(getJqueryInterfaceForPlugin(ScrollSpy)).toEqual(jQuery.fn.scrollspy)
|
expect(jQuery.fn.dropdown).toBeDefined()
|
||||||
expect(getJqueryInterfaceForPlugin(Tab)).toEqual(jQuery.fn.tab)
|
expect(jQuery.fn.modal).toBeDefined()
|
||||||
expect(getJqueryInterfaceForPlugin(Toast)).toEqual(jQuery.fn.toast)
|
expect(jQuery.fn.offcanvas).toBeDefined()
|
||||||
expect(getJqueryInterfaceForPlugin(Tooltip)).toEqual(jQuery.fn.tooltip)
|
expect(jQuery.fn.popover).toBeDefined()
|
||||||
|
expect(jQuery.fn.scrollspy).toBeDefined()
|
||||||
|
expect(jQuery.fn.tab).toBeDefined()
|
||||||
|
expect(jQuery.fn.toast).toBeDefined()
|
||||||
|
expect(jQuery.fn.tooltip).toBeDefined()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should use jQuery event system', () => {
|
it('should use jQuery event system', () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user