Files
iD/test/spec/svg.js
John Firebaugh 5ea855e18d Replace Graph#fetch with Graph#childNodes
Having two kinds of Ways (fetched and non-fetched)
introduced some accidental complexity. This brings things
more in line with how parentWays/parentRelations work.

Fixes #73.
2013-01-25 15:10:44 -05:00

20 lines
664 B
JavaScript

describe("iD.svg.LineString", function () {
it("returns an SVG path description for the entity's nodes", function () {
var a = iD.Node({loc: [0, 0]}),
b = iD.Node({loc: [2, 3]}),
way = iD.Way({nodes: [a.id, b.id]}),
graph = iD.Graph([a, b, way]),
projection = Object;
expect(iD.svg.LineString(projection, graph)(way)).to.equal("M0,0L2,3");
});
it("returns null for an entity with no nodes", function () {
var way = iD.Way(),
graph = iD.Graph([way]),
projection = Object;
expect(iD.svg.LineString(projection, graph)(way)).to.be.null;
});
});