Browse Source

added test to check if the a custom plugin can overrides a default command

pull/356/head
Arthur Almeida 8 years ago
parent
commit
608d33e16f
  1. 16
      test/specs/grapesjs/index.js

16
test/specs/grapesjs/index.js

@ -229,6 +229,22 @@ describe('GrapesJS', () => {
expect(editor.getDevice()).toEqual('Tablet'); expect(editor.getDevice()).toEqual('Tablet');
}); });
it('Init new editor with custom plugin override default commands', () => {
var editor,
pluginName = 'test-plugin-opts';
obj.plugins.add(pluginName, (edt, opts) => {
let cmdm = edt.Commands;
// Overwrite export template
cmdm.add('export-template', {test: 1});
});
config.plugins = [pluginName];
editor = obj.init(config);
editor.Commands.init()
expect(editor.Commands.get('export-template').test).toEqual(1);
});
}); });
}); });

Loading…
Cancel
Save