- });
-
- describe.only('Metadata API', function() {
- it('allows to set metadata on an element node', function() {
- var doc = getDocumentFromXML('<section></section>');
- expect(doc.root.getMetadata()).to.deep.equal([]);
- doc.root.addMetadataRow({key: 'key', value: 'value'});
- expect(doc.root.getMetadata()).to.deep.equal([{key: 'key', value: 'value'}]);
- });
-
- it('reads node\'s metadata from its metadata child node', function() {
- var doc = getDocumentFromXML('<section><metadata><dc:key>value</dc:key></metadata></section>');
- expect(doc.root.getMetadata()).to.deep.equal([{key: 'key', value: 'value'}]);
- });