Files
iD/test/spec/svg/vertices.js
T
John Firebaugh 70e5411114 Optimize vertex rendering
* Cache icon
* Append rather than insert
* Do fewer things on update
* Don't create a fill unless needed
* Don't apply tag and member classes (never used)
* Drop down to raw setAttribute (d3 is slow :trollface:)
2013-05-13 09:37:48 -07:00

23 lines
746 B
JavaScript

describe("iD.svg.Vertices", function () {
var surface,
projection = Object,
context;
beforeEach(function () {
context = iD();
surface = d3.select(document.createElementNS('http://www.w3.org/2000/svg', 'svg'))
.call(iD.svg.Surface(context));
});
it("adds the .shared class to vertices that are members of two or more ways", function () {
var node = iD.Node({loc: [0, 0]}),
way1 = iD.Way({nodes: [node.id]}),
way2 = iD.Way({nodes: [node.id]}),
graph = iD.Graph([node, way1, way2]);
surface.call(iD.svg.Vertices(projection, context), graph, [node], 17);
expect(surface.select('.vertex')).to.be.classed('shared');
});
});