From 8818bf1b1c8395fa60c246527045c8b4e9bf686a Mon Sep 17 00:00:00 2001 From: Quincy Morgan Date: Wed, 11 Dec 2019 18:05:26 -0500 Subject: [PATCH] Fix code tests to represent moved multipolygon line classes behavior --- test/spec/svg/lines.js | 13 +++++++++++++ test/spec/svg/tag_classes.js | 10 ---------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/test/spec/svg/lines.js b/test/spec/svg/lines.js index 66efcd5aa..1edce33ef 100644 --- a/test/spec/svg/lines.js +++ b/test/spec/svg/lines.js @@ -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]}); diff --git a/test/spec/svg/tag_classes.js b/test/spec/svg/tag_classes.js index 267d9347d..488c906c5 100644 --- a/test/spec/svg/tag_classes.js +++ b/test/spec/svg/tag_classes.js @@ -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