2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-06-05 16:42:29 +03:00

Js - use a default JQueryInterface in js components

This commit is contained in:
GeoSot
2021-12-02 18:12:53 +02:00
parent 88a6610895
commit dd9f2b31d0
27 changed files with 161 additions and 239 deletions
+5 -4
View File
@@ -2,6 +2,7 @@ import Tooltip from '../../src/tooltip'
import EventHandler from '../../src/dom/event-handler'
import { noop } from '../../src/util/index'
import { clearFixture, createEvent, getFixture, jQueryMock } from '../helpers/fixture'
import { getJqueryInterfaceForPlugin } from '../../src/util/jquery-stuff'
describe('Tooltip', () => {
let fixtureEl
@@ -1455,7 +1456,7 @@ describe('Tooltip', () => {
const div = fixtureEl.querySelector('div')
jQueryMock.fn.tooltip = Tooltip.jQueryInterface
jQueryMock.fn.tooltip = getJqueryInterfaceForPlugin(Tooltip)
jQueryMock.elements = [div]
jQueryMock.fn.tooltip.call(jQueryMock)
@@ -1469,7 +1470,7 @@ describe('Tooltip', () => {
const div = fixtureEl.querySelector('div')
const tooltip = new Tooltip(div)
jQueryMock.fn.tooltip = Tooltip.jQueryInterface
jQueryMock.fn.tooltip = getJqueryInterfaceForPlugin(Tooltip)
jQueryMock.elements = [div]
jQueryMock.fn.tooltip.call(jQueryMock)
@@ -1485,7 +1486,7 @@ describe('Tooltip', () => {
spyOn(tooltip, 'show')
jQueryMock.fn.tooltip = Tooltip.jQueryInterface
jQueryMock.fn.tooltip = getJqueryInterfaceForPlugin(Tooltip)
jQueryMock.elements = [div]
jQueryMock.fn.tooltip.call(jQueryMock, 'show')
@@ -1500,7 +1501,7 @@ describe('Tooltip', () => {
const div = fixtureEl.querySelector('div')
const action = 'undefinedMethod'
jQueryMock.fn.tooltip = Tooltip.jQueryInterface
jQueryMock.fn.tooltip = getJqueryInterfaceForPlugin(Tooltip)
jQueryMock.elements = [div]
expect(() => {