div.setData('key', 'value');
div.setData('clonableObject', new ClonableObject('test'));
div.setData('key', 'value');
div.setData('clonableObject', new ClonableObject('test'));
var rootClone = root.clone(),
divClone = rootClone.contents()[0],
var rootClone = root.clone(),
divClone = rootClone.contents()[0],
stringClone = divClone.getData('key'),
objClone = divClone.getData('clonableObject');
expect(stringClone).to.equal('value');
expect(objClone.arg).to.equal('test', 'clonable object got copied');
expect(objClone !== div.getData('clonableObject')).to.be.equal(true, 'copy of the clonable object is a new object');
stringClone = divClone.getData('key'),
objClone = divClone.getData('clonableObject');
expect(stringClone).to.equal('value');
expect(objClone.arg).to.equal('test', 'clonable object got copied');
expect(objClone !== div.getData('clonableObject')).to.be.equal(true, 'copy of the clonable object is a new object');
- var section = elementNodeFromXML('<section>Alice<x></x><div>a cat</div></section>'),
- aliceText = section.contents()[0],
- x = section.contents()[1],
- lastDiv = section.contents()[2];
+ var section = elementNodeFromXML('<section>Alice<x></x><div>a cat</div></section>');