1
0
Fork 0

GraphViewer: Added an additional test for label switching

This commit is contained in:
Michael Hackstein 2013-03-30 12:51:05 +01:00
parent e23edd007d
commit 1507b32314
1 changed files with 15 additions and 0 deletions

View File

@ -403,6 +403,21 @@
expect($("svg .node text")[0].textContent).toEqual("0");
});
it('should be able to switch to another label during runtime', function() {
var node = [{
_id: 1,
label: "before",
switched: "after"
}];
shaper.drawNodes(node);
expect($("svg .node text")[0].textContent).toEqual("before");
shaper.changeTo({label: "switched"});
expect($("svg .node text")[0]).toBeDefined();
expect($("svg .node text").length).toEqual(1);
expect($("svg .node text")[0].textContent).toEqual("after");
});
});
describe('using a function for labels', function () {