mirror of
https://github.com/Shopify/draggable.git
synced 2026-02-01 16:46:56 +00:00
Makes default draggable plugins available statically
This commit is contained in:
parent
0e70ce0e7d
commit
c0688c68fd
@ -62,6 +62,16 @@ export const defaultOptions = {
|
||||
*/
|
||||
export default class Draggable {
|
||||
|
||||
/**
|
||||
* Default plugins draggable uses
|
||||
* @static
|
||||
* @property {Object} Plugins
|
||||
* @property {Mirror} Plugins.Mirror
|
||||
* @property {Accessibility} Plugins.Accessibility
|
||||
* @type {Object}
|
||||
*/
|
||||
static Plugins = {Mirror, Accessibility};
|
||||
|
||||
/**
|
||||
* Draggable constructor.
|
||||
* @constructs Draggable
|
||||
|
||||
@ -49,6 +49,14 @@ describe('Draggable', () => {
|
||||
sandbox.parentNode.removeChild(sandbox);
|
||||
});
|
||||
|
||||
describe('.Plugins', () => {
|
||||
test('should be available statically', () => {
|
||||
expect(Draggable.Plugins).toBeDefined();
|
||||
expect(Draggable.Plugins.Mirror).toEqual(Mirror);
|
||||
expect(Draggable.Plugins.Accessibility).toEqual(Accessibility);
|
||||
});
|
||||
});
|
||||
|
||||
describe('#constructor', () => {
|
||||
test('should be an instance of Draggable', () => {
|
||||
const draggable = new Draggable(containers, {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user