mirror of https://github.com/artf/grapesjs.git
nocodeframeworkdrag-and-dropsite-buildersite-generatortemplate-builderui-builderweb-builderweb-builder-frameworkwebsite-builderno-codepage-builder
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.
53 lines
1.4 KiB
53 lines
1.4 KiB
var path = 'SelectorManager/model/';
|
|
define([path + 'Selector',
|
|
path + 'Selectors'],
|
|
function(Selector, Selectors) {
|
|
|
|
return {
|
|
run : function(){
|
|
describe('Selector', function() {
|
|
|
|
beforeEach(function () {
|
|
this.obj = new Selector();
|
|
});
|
|
|
|
afterEach(function () {
|
|
delete this.obj;
|
|
});
|
|
|
|
it('Has name property', function() {
|
|
this.obj.has('name').should.equal(true);
|
|
});
|
|
|
|
it('Has label property', function() {
|
|
this.obj.has('label').should.equal(true);
|
|
});
|
|
|
|
it('Has active property', function() {
|
|
this.obj.has('active').should.equal(true);
|
|
});
|
|
|
|
it('escapeName test', function() {
|
|
this.obj.escapeName('@Te sT*').should.equal('-Te-sT-');
|
|
});
|
|
|
|
it('Name is corrected at instantiation', function() {
|
|
this.obj = new Selector({ name: '@Te sT*'});
|
|
this.obj.get('name').should.equal('-Te-sT-');
|
|
});
|
|
|
|
|
|
});
|
|
describe('Selectors', function() {
|
|
|
|
it('Creates collection item correctly', function() {
|
|
var c = new Selectors();
|
|
var m = c.add({});
|
|
m.should.be.an.instanceOf(Selector);
|
|
});
|
|
|
|
});
|
|
}
|
|
};
|
|
|
|
});
|
|
|