mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-13 00:54:04 +02:00
Extract static DATA_KEY
& EVENT_KEY
to base-component (#33635)
* Force each plugin that extends base-components to implement a static method `NAME()` * Remove redundant `NAME` argument from 'Utils.defineJQueryPlugin' & fix test
This commit is contained in:
@@ -560,9 +560,10 @@ describe('Util', () => {
|
||||
|
||||
it('should define a plugin on the jQuery instance', () => {
|
||||
const pluginMock = function () {}
|
||||
pluginMock.NAME = 'test'
|
||||
pluginMock.jQueryInterface = function () {}
|
||||
|
||||
Util.defineJQueryPlugin('test', pluginMock)
|
||||
Util.defineJQueryPlugin(pluginMock)
|
||||
expect(fakejQuery.fn.test).toBe(pluginMock.jQueryInterface)
|
||||
expect(fakejQuery.fn.test.Constructor).toBe(pluginMock)
|
||||
expect(typeof fakejQuery.fn.test.noConflict).toEqual('function')
|
||||
|
Reference in New Issue
Block a user