2 'libs/jquery-1.9.1.min',
\r
5 'modules/documentCanvas/canvasNode'
\r
6 ], function($, chai, utils, canvasNode) {
\r
10 var assert = chai.assert;
\r
12 var assertDomEqual = function(lhs, rhs) {
\r
15 return assert.ok(lhs[0].isEqualNode(rhs[0]), 'nodes are equal');
\r
19 suite('Create canvas node', function() {
\r
20 test('from description', function() {
\r
21 var node = canvasNode.create({tag: 'header', klass: 'some-class', content: 'some text content'});
\r
22 assert.equal(node.getTag(), 'header');
\r
23 assert.equal(node.getClass(), 'some-class');
\r
24 assert.equal(node.getContent(), 'some text content');
\r
25 assertDomEqual($('<div wlxml-tag="header" wlxml-class="some-class">some text content</div>'), node.dom);
\r
28 test('from dom object', function() {
\r
29 var node = canvasNode.create($('<div wlxml-tag="header" wlxml-class="some-class" id="1">'));
\r
30 assert.equal(node.getTag(), 'header');
\r
31 assert.equal(node.getClass(), 'some-class');
\r
32 //assertDomEqual($('<div wlxml-tag="header" wlxml-class="some-class">'), node.dom);
\r
36 suite('comparing nodes', function() {
\r
37 test('isSame', function() {
\r
38 var html = '<div wlxml-class="some-class" wlxml-tag="some-tag">';
\r
41 assert.ok(canvasNode.create(dom1).isSame(canvasNode.create(dom1)));
\r
42 assert.notOk(canvasNode.create(dom1).isSame(canvasNode.create(dom2)));
\r