mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 17:23:02 +00:00
27 lines
907 B
JavaScript
27 lines
907 B
JavaScript
describe('iD.svgPoints', function () {
|
|
var context, surface;
|
|
var projection = d3.geoProjection(function(x, y) { return [x, -y]; })
|
|
.translate([0, 0])
|
|
.scale(iD.geoZoomToScale(17))
|
|
.clipExtent([[0, 0], [Infinity, Infinity]]);
|
|
|
|
beforeEach(function () {
|
|
context = iD.coreContext();
|
|
d3.select(document.createElement('div'))
|
|
.attr('id', 'map')
|
|
.call(context.map().centerZoom([0, 0], 17));
|
|
surface = context.surface();
|
|
});
|
|
|
|
|
|
it('adds tag classes', function () {
|
|
var point = iD.osmNode({tags: {amenity: 'cafe'}, loc: [0, 0]});
|
|
var graph = iD.coreGraph([point]);
|
|
|
|
surface.call(iD.svgPoints(projection, context), graph, [point]);
|
|
|
|
expect(surface.select('.point').classed('tag-amenity')).to.be.true;
|
|
expect(surface.select('.point').classed('tag-amenity-cafe')).to.be.true;
|
|
});
|
|
});
|