mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-12 16:52:50 +00:00
Fix code tests to represent moved multipolygon line classes behavior
This commit is contained in:
@@ -29,6 +29,19 @@ describe('iD.svgLines', function () {
|
||||
expect(surface.select('path.line').classed('line')).to.be.true;
|
||||
});
|
||||
|
||||
it('adds relation and area classes for untagged line member of multipolygon', function () {
|
||||
var a = iD.osmNode({loc: [0, 0]});
|
||||
var b = iD.osmNode({loc: [1, 1]});
|
||||
var line = iD.osmWay({nodes: [a.id, b.id]});
|
||||
var relation = iD.osmRelation({members: [{id: line.id}], tags: {type: 'multipolygon', natural: 'wood'}});
|
||||
var graph = iD.coreGraph([a, b, line, relation]);
|
||||
|
||||
surface.call(iD.svgLines(projection, context), graph, [line], all);
|
||||
|
||||
expect(surface.select('.stroke').classed('relation')).to.be.true;
|
||||
expect(surface.select('.stroke').classed('area')).to.be.true;
|
||||
});
|
||||
|
||||
it('adds tag classes', function () {
|
||||
var a = iD.osmNode({loc: [0, 0]});
|
||||
var b = iD.osmNode({loc: [1, 1]});
|
||||
|
||||
@@ -239,16 +239,6 @@ describe('iD.svgTagClasses', function () {
|
||||
expect(selection.classed('line')).to.be.true;
|
||||
});
|
||||
|
||||
it('stroke overrides: renders simple multipolygon lines as areas', function() {
|
||||
var multipolygon = function () { return { type: 'multipolygon' }; };
|
||||
selection
|
||||
.attr('class', 'way line stroke')
|
||||
.datum(iD.osmEntity({tags: {}}))
|
||||
.call(iD.svgTagClasses().tags(multipolygon));
|
||||
expect(selection.classed('area')).to.be.true;
|
||||
expect(selection.classed('line')).to.be.false;
|
||||
});
|
||||
|
||||
it('works on SVG elements', function() {
|
||||
selection = d3.select(document.createElementNS('http://www.w3.org/2000/svg', 'g'));
|
||||
selection
|
||||
|
||||
Reference in New Issue
Block a user