Files
iD/test/spec/svg/points.js
2016-10-04 21:56:09 -04:00

27 lines
873 B
JavaScript

describe('iD.svgPoints', function () {
var context, surface,
projection = d3.geoProjection(function(x, y) { return [x, -y]; })
.translate([0, 0])
.scale(180 / Math.PI)
.clipExtent([[0, 0], [Infinity, Infinity]]);
beforeEach(function () {
context = iD.Context(window);
d3.select(document.createElement('div'))
.attr('id', 'map')
.call(context.map());
surface = context.surface();
});
it('adds tag classes', function () {
var point = iD.Node({tags: {amenity: 'cafe'}, loc: [0, 0]}),
graph = iD.Graph([point]);
surface.call(iD.svgPoints(projection, context), graph, [point]);
expect(surface.select('.point')).to.be.classed('tag-amenity');
expect(surface.select('.point')).to.be.classed('tag-amenity-cafe');
});
});