children = c.doc().children();
expect(children.length).to.equal(1);
- expect(children[0].sameNode(appended));
+ expect(children[0].sameNode(appended)).to.be.true;
});
it('can put new TextElement at the end', function() {
children = c.doc().children();
expect(children.length).to.equal(1);
- expect(children[0].sameNode(appended));
+ expect(children[0].sameNode(appended)).to.be.true;
expect(children[0].getText()).to.equal('Alice');
});
added = div.after({tag: 'header', klass: 'some.class'}),
children = c.doc().children();
expect(children.length).to.equal(2);
- expect(children[1].sameNode(added));
+ expect(children[1].sameNode(added)).to.be.true;
});
it('can put new Nodeelement before another element', function() {
added = div.before({tag: 'header', klass: 'some.class'}),
children = c.doc().children();
expect(children.length).to.equal(2);
- expect(children[0].sameNode(added));
+ expect(children[0].sameNode(added)).to.be.true;
});
it('can put new DocumentNodeElement after DocumentTextElement', function() {
$.extend(DocumentNodeElement.prototype, {
append: function(params) {
- manipulate(this, params, 'append');
+ return manipulate(this, params, 'append');
},
before: function(params) {
- manipulate(this, params, 'before');
+ return manipulate(this, params, 'before');
},
after: function(params) {
- manipulate(this, params, 'after');
+ return manipulate(this, params, 'after');
},
children: function() {
var toret = [];