Free and Open source Web Builder Framework. Next generation tool for building templates without coding
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

46 lines
996 B

var modulePath = './../../../test/specs/plugin_manager';
define(['PluginManager'], function(PluginManager) {
describe('PluginManager', function() {
describe('Main', function() {
var obj;
var val;
var testPlugin = function(e){
val = e;
};
beforeEach(function () {
obj = new PluginManager();
});
afterEach(function () {
delete obj;
});
it('Object exists', function() {
obj.should.be.exist;
});
it('No plugins inside', function() {
obj.getAll().should.be.empty;
});
it('Add new plugin', function() {
obj.add('test', testPlugin);
obj.get('test').should.not.be.empty;
});
it('Added plugin is working', function() {
obj.add('test', testPlugin);
var plugin = obj.get('test');
plugin('tval');
val.should.equal('tval');
});
});
});
});