metaWidget wip: reacting to class change
[fnpeditor.git] / modules / documentCanvas / tests / canvasNode.test.js
index 5dccf7b..0077d46 100644 (file)
@@ -78,6 +78,18 @@ suite('meta attributes', function() {
         var node = canvasNode.create({tag: 'tag', meta: {a:'1'}});
         node.setMetaAttr('a', '2');
         assert.equal(node.dom.attr('wlxml-meta-a'), '2');
+    });
+});
+
+suite('modifing node', function() {
+    test('changing class removes meta attributes', function() {
+        var node = canvasNode.create({tag: 'span', klass: 'uri', meta: {uri: 'http://some.uri.com'}});
+        
+        assert.equal(node.getMetaAttr('uri'), 'http://some.uri.com');
+
+        node.setClass('author');
+
+        assert.equal(node.getMetaAttr('uri'), undefined);
     })
 })