Skip to content

Commit

Permalink
Adding another test to ensure attributes aren't carried over between …
Browse files Browse the repository at this point in the history
…node definitions
  • Loading branch information
ress committed Feb 18, 2013
1 parent 40a3dff commit a35c5bc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/dot-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,10 @@ describe("dagre.dot.toGraph", function() {
// defined nodes could be overwritten, causing both nodes in this test case to
// have "color" set to green.
});
it("does not carry attributes from one node over to the next", function() {
var dot = "digraph { node [color=black]; n1 [label=\"n1\" fontsize=12]; n2 [label=\"n2\"]; n1 -> n2; }";
var g = dagre.dot.toGraph(dot);
assert.equal(g.node("n1").fontsize, 12);
assert.equal(g.node("n2").fontsize, undefined, "n2.fontsize should not be defined");
});
});

0 comments on commit a35c5bc

Please sign in to comment.