X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/9db0e3facfdcb376b589ea922215bbdb1a3d1787..a72a2ac218147b7c6874fbdc361d0a3fb6532a88:/modules/documentCanvas/canvas/canvas.test3.js?ds=sidebyside
diff --git a/modules/documentCanvas/canvas/canvas.test3.js b/modules/documentCanvas/canvas/canvas.test3.js
index 030ff19..c4dc610 100644
--- a/modules/documentCanvas/canvas/canvas.test3.js
+++ b/modules/documentCanvas/canvas/canvas.test3.js
@@ -126,6 +126,35 @@ describe('Canvas', function() {
section.setWlxmlClass(null);
expect(section.getWlxmlClass()).to.be.undefined;
});
+
+
+
+ describe('element has meta attributes', function() {
+ it('can change its meta attributes', function() {
+ var c = canvas.fromXML(''),
+ span = c.doc().children()[0];
+
+ expect(span.getWlxmlMetaAttr('uri')).to.equal('someuri');
+ span.setWlxmlMetaAttr('uri', 'otheruri');
+ expect(span.getWlxmlMetaAttr('uri')).to.equal('otheruri');
+ });
+
+ it('changes its meta attributes with class change', function() {
+ var c = canvas.fromXML(''),
+ span = c.doc().children()[0];
+
+ expect(span.getWlxmlMetaAttr('uri')).to.equal('someuri');
+ span.setWlxmlClass('author');
+ expect(span.getWlxmlMetaAttr('uri')).to.be.undefined;
+ });
+
+ it('keeps meta attribute value on class change if a new class has this attribute', function() {
+ var c = canvas.fromXML(''),
+ span = c.doc().children()[0];
+ span.setWlxmlClass('uri.some.subclass');
+ expect(span.getWlxmlMetaAttr('uri')).to.equal('someuri');
+ });
+ });
});
it('returns DocumentNodeElement instance from HTMLElement', function() {