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.
36 lines
1.4 KiB
36 lines
1.4 KiB
define(['componentModel'],
|
|
function(componentModel) {
|
|
describe('Component', function() {
|
|
|
|
it('Contiene valori di default', function() {//Has default values
|
|
var model = new componentModel({});
|
|
var modelComponents = model.components;
|
|
model.should.be.ok;
|
|
model.get('tagName').should.equal("div");
|
|
model.get('classes').should.be.empty;
|
|
model.get('css').should.be.empty;
|
|
model.get('attributes').should.be.empty;
|
|
modelComponents.models.should.be.empty;
|
|
});
|
|
it('Non ci sono altri componenti all\'interno ', function() {//No other components inside
|
|
var model = new componentModel({});
|
|
var modelComponents = model.components;
|
|
model.should.be.ok;
|
|
modelComponents.models.should.be.empty;
|
|
});
|
|
it('Imposta valori passati', function() {//Sets passed attributes
|
|
var model = new componentModel({
|
|
tagName : 'span',
|
|
classes : ['one','two','three'],
|
|
css : { 'one':'vone', 'two':'vtwo', },
|
|
attributes : { 'data-one':'vone', 'data-two':'vtwo', },
|
|
});
|
|
model.should.be.ok;
|
|
model.get('tagName').should.equal("span");
|
|
model.get('classes').should.have.length(3);
|
|
model.get('css').should.have.keys(["one", "two",]);
|
|
model.get('attributes').should.have.keys(["data-one", "data-two",]);
|
|
});
|
|
it('Possibilità di istanziare componenti annidati'); //Possibility to init nested components
|
|
});
|
|
});
|