Makes default draggable plugins available statically

This commit is contained in:
Max Hoffmann 2018-01-10 14:14:17 -05:00
parent 0e70ce0e7d
commit c0688c68fd
No known key found for this signature in database
GPG Key ID: 1DFA4D13DD27A676
2 changed files with 18 additions and 0 deletions

View File

@ -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

View File

@ -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, {