+
+ describe('Storing custom data', function() {
+ var node;
+
+ beforeEach(function() {
+ node = elementNodeFromXML('<div></div>');
+ });
+
+ it('can append single value', function() {
+ node.setData('key', 'value');
+ expect(node.getData('key')).to.equal('value');
+ });
+
+ it('can overwrite the whole data', function() {
+ node.setData('key1', 'value1');
+ node.setData({key2: 'value2'});
+ expect(node.getData('key2')).to.equal('value2');
+ });
+
+ it('can fetch the whole data at once', function() {
+ node.setData({key1: 'value1', key2: 'value2'});
+ expect(node.getData()).to.eql({key1: 'value1', key2: 'value2'});
+ });
+ });