4 ], function(chai, smartxml) {
9 var expect = chai.expect;
12 var getDocumentFromXML = function(xml) {
13 return smartxml.documentFromXML(xml);
16 var elementNodeFromParams = function(params) {
17 return smartxml.elementNodeFromXML('<' + params.tag + '></' + params.tag + '>');
21 describe.only('smartxml', function() {
23 describe('Basic use', function() {
24 it('exposes root element', function() {
25 var doc = getDocumentFromXML('<div></div>');
26 expect(doc.root.getTagName()).to.equal('div');
30 describe('Manipulations', function() {
32 it('appende element node to another element node', function() {
33 var node1 = elementNodeFromParams({tag: 'div'}),
34 node2 = elementNodeFromParams({tag: 'a'});
36 expect(node1.contents()[0].sameNode(node2)).to.be.true;