mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 09:12:52 +00:00
Remove linting errors fromspec/svg
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"start": "http-server .",
|
||||
"lint": "eslint js/id && npm run lint:spec",
|
||||
"lint:modules": "eslint modules",
|
||||
"lint:spec": "eslint test/spec/actions test/spec/behavior test/spec/core test/spec/geo test/spec/lib test/spec/presets test/spec/modes"
|
||||
"lint:spec": "eslint test/spec/actions test/spec/behavior test/spec/core test/spec/geo test/spec/lib test/spec/presets test/spec/modes test/spec/renderer test/spec/svg"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
describe("iD.svg.Areas", function () {
|
||||
describe('iD.svg.Areas', function () {
|
||||
var surface,
|
||||
projection = d3.geo.projection(function(x, y) { return [x, y]; })
|
||||
.clipExtent([[0, 0], [Infinity, Infinity]]),
|
||||
@@ -10,7 +10,7 @@ describe("iD.svg.Areas", function () {
|
||||
.call(iD.svg.Layers(projection, iD()));
|
||||
});
|
||||
|
||||
it("adds way and area classes", function () {
|
||||
it('adds way and area classes', function () {
|
||||
var graph = iD.Graph([
|
||||
iD.Node({id: 'a', loc: [0, 0]}),
|
||||
iD.Node({id: 'b', loc: [1, 0]}),
|
||||
@@ -25,7 +25,7 @@ describe("iD.svg.Areas", function () {
|
||||
expect(surface.select('path.area')).to.be.classed('area');
|
||||
});
|
||||
|
||||
it("adds tag classes", function () {
|
||||
it('adds tag classes', function () {
|
||||
var graph = iD.Graph([
|
||||
iD.Node({id: 'a', loc: [0, 0]}),
|
||||
iD.Node({id: 'b', loc: [1, 0]}),
|
||||
@@ -40,7 +40,7 @@ describe("iD.svg.Areas", function () {
|
||||
expect(surface.select('.area')).to.be.classed('tag-building-yes');
|
||||
});
|
||||
|
||||
it("handles deletion of a way and a member vertex (#1903)", function () {
|
||||
it('handles deletion of a way and a member vertex (#1903)', function () {
|
||||
var graph = iD.Graph([
|
||||
iD.Node({id: 'a', loc: [0, 0]}),
|
||||
iD.Node({id: 'b', loc: [1, 0]}),
|
||||
@@ -57,7 +57,7 @@ describe("iD.svg.Areas", function () {
|
||||
expect(surface.select('.area').size()).to.equal(1);
|
||||
});
|
||||
|
||||
describe("z-indexing", function() {
|
||||
describe('z-indexing', function() {
|
||||
var graph = iD.Graph([
|
||||
iD.Node({id: 'a', loc: [-0.0002, 0.0001]}),
|
||||
iD.Node({id: 'b', loc: [ 0.0002, 0.0001]}),
|
||||
@@ -71,21 +71,21 @@ describe("iD.svg.Areas", function () {
|
||||
iD.Way({id: 'l', tags: {landuse: 'park'}, nodes: ['e', 'f', 'g', 'h', 'e']})
|
||||
]);
|
||||
|
||||
it("stacks smaller areas above larger ones in a single render", function () {
|
||||
it('stacks smaller areas above larger ones in a single render', function () {
|
||||
surface.call(iD.svg.Areas(projection), graph, [graph.entity('s'), graph.entity('l')], none);
|
||||
|
||||
expect(surface.select('.area:nth-child(1)')).to.be.classed('tag-landuse-park');
|
||||
expect(surface.select('.area:nth-child(2)')).to.be.classed('tag-building-yes');
|
||||
});
|
||||
|
||||
it("stacks smaller areas above larger ones in a single render (reverse)", function () {
|
||||
it('stacks smaller areas above larger ones in a single render (reverse)', function () {
|
||||
surface.call(iD.svg.Areas(projection), graph, [graph.entity('l'), graph.entity('s')], none);
|
||||
|
||||
expect(surface.select('.area:nth-child(1)')).to.be.classed('tag-landuse-park');
|
||||
expect(surface.select('.area:nth-child(2)')).to.be.classed('tag-building-yes');
|
||||
});
|
||||
|
||||
it("stacks smaller areas above larger ones in separate renders", function () {
|
||||
it('stacks smaller areas above larger ones in separate renders', function () {
|
||||
surface.call(iD.svg.Areas(projection), graph, [graph.entity('s')], none);
|
||||
surface.call(iD.svg.Areas(projection), graph, [graph.entity('l')], none);
|
||||
|
||||
@@ -93,7 +93,7 @@ describe("iD.svg.Areas", function () {
|
||||
expect(surface.select('.area:nth-child(2)')).to.be.classed('tag-building-yes');
|
||||
});
|
||||
|
||||
it("stacks smaller areas above larger ones in separate renders (reverse)", function () {
|
||||
it('stacks smaller areas above larger ones in separate renders (reverse)', function () {
|
||||
surface.call(iD.svg.Areas(projection), graph, [graph.entity('l')], none);
|
||||
surface.call(iD.svg.Areas(projection), graph, [graph.entity('s')], none);
|
||||
|
||||
@@ -102,7 +102,7 @@ describe("iD.svg.Areas", function () {
|
||||
});
|
||||
});
|
||||
|
||||
it("renders fills for multipolygon areas", function () {
|
||||
it('renders fills for multipolygon areas', function () {
|
||||
var a = iD.Node({loc: [1, 1]}),
|
||||
b = iD.Node({loc: [2, 2]}),
|
||||
c = iD.Node({loc: [3, 3]}),
|
||||
@@ -116,7 +116,7 @@ describe("iD.svg.Areas", function () {
|
||||
expect(surface.select('.fill')).to.be.classed('relation');
|
||||
});
|
||||
|
||||
it("renders no strokes for multipolygon areas", function () {
|
||||
it('renders no strokes for multipolygon areas', function () {
|
||||
var a = iD.Node({loc: [1, 1]}),
|
||||
b = iD.Node({loc: [2, 2]}),
|
||||
c = iD.Node({loc: [3, 3]}),
|
||||
@@ -130,7 +130,7 @@ describe("iD.svg.Areas", function () {
|
||||
expect(surface.selectAll('.stroke')[0].length).to.equal(0);
|
||||
});
|
||||
|
||||
it("renders fill for a multipolygon with tags on the outer way", function() {
|
||||
it('renders fill for a multipolygon with tags on the outer way', function() {
|
||||
var a = iD.Node({loc: [1, 1]}),
|
||||
b = iD.Node({loc: [2, 2]}),
|
||||
c = iD.Node({loc: [3, 3]}),
|
||||
@@ -145,7 +145,7 @@ describe("iD.svg.Areas", function () {
|
||||
expect(surface.select('.relation.fill')).to.be.classed('tag-natural-wood');
|
||||
});
|
||||
|
||||
it("renders no strokes for a multipolygon with tags on the outer way", function() {
|
||||
it('renders no strokes for a multipolygon with tags on the outer way', function() {
|
||||
var a = iD.Node({loc: [1, 1]}),
|
||||
b = iD.Node({loc: [2, 2]}),
|
||||
c = iD.Node({loc: [3, 3]}),
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
describe("iD.svg.Icon", function () {
|
||||
describe('iD.svg.Icon', function () {
|
||||
var selection;
|
||||
|
||||
beforeEach(function () {
|
||||
selection = d3.select(document.createElement('div'));
|
||||
});
|
||||
|
||||
it("creates a generic SVG icon", function () {
|
||||
it('creates a generic SVG icon', function () {
|
||||
selection.call(iD.svg.Icon('#icon-bug'));
|
||||
expect(selection.select('svg')).to.be.classed('icon');
|
||||
expect(selection.select('use').attr('xlink:href')).to.eql('#icon-bug');
|
||||
});
|
||||
|
||||
it("classes the 'svg' and 'use' elements", function () {
|
||||
it('classes the \'svg\' and \'use\' elements', function () {
|
||||
selection.call(iD.svg.Icon('#icon-bug', 'svg-class', 'use-class'));
|
||||
expect(selection.select('svg')).to.be.classed('icon svg-class');
|
||||
expect(selection.select('use')).to.be.classed('use-class');
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
describe("iD.svg.Lines", function () {
|
||||
describe('iD.svg.Lines', function () {
|
||||
var surface,
|
||||
projection = d3.geo.projection(function(x, y) { return [x, y]; })
|
||||
.clipExtent([[0, 0], [Infinity, Infinity]]),
|
||||
@@ -10,7 +10,7 @@ describe("iD.svg.Lines", function () {
|
||||
.call(iD.svg.Layers(projection, iD()));
|
||||
});
|
||||
|
||||
it("adds way and line classes", function () {
|
||||
it('adds way and line classes', function () {
|
||||
var a = iD.Node({loc: [0, 0]}),
|
||||
b = iD.Node({loc: [1, 1]}),
|
||||
line = iD.Way({nodes: [a.id, b.id]}),
|
||||
@@ -22,7 +22,7 @@ describe("iD.svg.Lines", function () {
|
||||
expect(surface.select('path.line')).to.be.classed('line');
|
||||
});
|
||||
|
||||
it("adds tag classes", function () {
|
||||
it('adds tag classes', function () {
|
||||
var a = iD.Node({loc: [0, 0]}),
|
||||
b = iD.Node({loc: [1, 1]}),
|
||||
line = iD.Way({nodes: [a.id, b.id], tags: {highway: 'residential'}}),
|
||||
@@ -34,7 +34,7 @@ describe("iD.svg.Lines", function () {
|
||||
expect(surface.select('.line')).to.be.classed('tag-highway-residential');
|
||||
});
|
||||
|
||||
it("adds stroke classes for the tags of the parent relation of multipolygon members", function() {
|
||||
it('adds stroke classes for the tags of the parent relation of multipolygon members', function() {
|
||||
var a = iD.Node({loc: [0, 0]}),
|
||||
b = iD.Node({loc: [1, 1]}),
|
||||
line = iD.Way({nodes: [a.id, b.id]}),
|
||||
@@ -46,7 +46,7 @@ describe("iD.svg.Lines", function () {
|
||||
expect(surface.select('.stroke')).to.be.classed('tag-natural-wood');
|
||||
});
|
||||
|
||||
it("renders stroke for outer way of multipolygon with tags on the outer way", function() {
|
||||
it('renders stroke for outer way of multipolygon with tags on the outer way', function() {
|
||||
var a = iD.Node({loc: [1, 1]}),
|
||||
b = iD.Node({loc: [2, 2]}),
|
||||
c = iD.Node({loc: [3, 3]}),
|
||||
@@ -59,7 +59,7 @@ describe("iD.svg.Lines", function () {
|
||||
expect(surface.select('.stroke')).to.be.classed('tag-natural-wood');
|
||||
});
|
||||
|
||||
it("adds stroke classes for the tags of the outer way of multipolygon with tags on the outer way", function() {
|
||||
it('adds stroke classes for the tags of the outer way of multipolygon with tags on the outer way', function() {
|
||||
var a = iD.Node({loc: [1, 1]}),
|
||||
b = iD.Node({loc: [2, 2]}),
|
||||
c = iD.Node({loc: [3, 3]}),
|
||||
@@ -73,7 +73,7 @@ describe("iD.svg.Lines", function () {
|
||||
expect(surface.select('.stroke')).to.be.classed('tag-natural-wood');
|
||||
});
|
||||
|
||||
describe("z-indexing", function() {
|
||||
describe('z-indexing', function() {
|
||||
var graph = iD.Graph([
|
||||
iD.Node({id: 'a', loc: [0, 0]}),
|
||||
iD.Node({id: 'b', loc: [1, 1]}),
|
||||
@@ -83,7 +83,7 @@ describe("iD.svg.Lines", function () {
|
||||
iD.Way({id: 'hi', tags: {highway: 'residential', bridge: 'yes'}, nodes: ['c', 'd']})
|
||||
]);
|
||||
|
||||
it("stacks higher lines above lower ones in a single render", function () {
|
||||
it('stacks higher lines above lower ones in a single render', function () {
|
||||
surface.call(iD.svg.Lines(projection), graph, [graph.entity('lo'), graph.entity('hi')], none);
|
||||
|
||||
var selection = surface.selectAll('g.line-stroke > path.line');
|
||||
@@ -91,7 +91,7 @@ describe("iD.svg.Lines", function () {
|
||||
expect(selection[0][1].__data__.id).to.eql('hi');
|
||||
});
|
||||
|
||||
it("stacks higher lines above lower ones in a single render (reverse)", function () {
|
||||
it('stacks higher lines above lower ones in a single render (reverse)', function () {
|
||||
surface.call(iD.svg.Lines(projection), graph, [graph.entity('hi'), graph.entity('lo')], none);
|
||||
|
||||
var selection = surface.selectAll('g.line-stroke > path.line');
|
||||
@@ -99,7 +99,7 @@ describe("iD.svg.Lines", function () {
|
||||
expect(selection[0][1].__data__.id).to.eql('hi');
|
||||
});
|
||||
|
||||
it("stacks higher lines above lower ones in separate renders", function () {
|
||||
it('stacks higher lines above lower ones in separate renders', function () {
|
||||
surface.call(iD.svg.Lines(projection), graph, [graph.entity('lo')], none);
|
||||
surface.call(iD.svg.Lines(projection), graph, [graph.entity('hi')], none);
|
||||
|
||||
@@ -108,7 +108,7 @@ describe("iD.svg.Lines", function () {
|
||||
expect(selection[0][1].__data__.id).to.eql('hi');
|
||||
});
|
||||
|
||||
it("stacks higher lines above lower in separate renders (reverse)", function () {
|
||||
it('stacks higher lines above lower in separate renders (reverse)', function () {
|
||||
surface.call(iD.svg.Lines(projection), graph, [graph.entity('hi')], none);
|
||||
surface.call(iD.svg.Lines(projection), graph, [graph.entity('lo')], none);
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
describe("iD.svg.Midpoints", function () {
|
||||
describe('iD.svg.Midpoints', function () {
|
||||
var surface,
|
||||
projection = Object,
|
||||
filter = d3.functor(true),
|
||||
@@ -10,7 +10,7 @@ describe("iD.svg.Midpoints", function () {
|
||||
.call(iD.svg.Layers(projection, context));
|
||||
});
|
||||
|
||||
it("creates midpoint on segment completely within the extent", function () {
|
||||
it('creates midpoint on segment completely within the extent', function () {
|
||||
var a = iD.Node({loc: [0, 0]}),
|
||||
b = iD.Node({loc: [50, 0]}),
|
||||
line = iD.Way({nodes: [a.id, b.id]}),
|
||||
@@ -24,7 +24,7 @@ describe("iD.svg.Midpoints", function () {
|
||||
expect(surface.select('.midpoint').datum().loc).to.eql([25, 0]);
|
||||
});
|
||||
|
||||
it("doesn't create midpoint on segment with pixel length less than 40", function () {
|
||||
it('doesn\'t create midpoint on segment with pixel length less than 40', function () {
|
||||
var a = iD.Node({loc: [0, 0]}),
|
||||
b = iD.Node({loc: [39, 0]}),
|
||||
line = iD.Way({nodes: [a.id, b.id]}),
|
||||
@@ -37,7 +37,7 @@ describe("iD.svg.Midpoints", function () {
|
||||
expect(surface.selectAll('.midpoint')[0]).to.have.length(0);
|
||||
});
|
||||
|
||||
it("doesn't create midpoint on segment completely outside of the extent", function () {
|
||||
it('doesn\'t create midpoint on segment completely outside of the extent', function () {
|
||||
var a = iD.Node({loc: [-100, 0]}),
|
||||
b = iD.Node({loc: [-50, 0]}),
|
||||
line = iD.Way({nodes: [a.id, b.id]}),
|
||||
@@ -50,7 +50,7 @@ describe("iD.svg.Midpoints", function () {
|
||||
expect(surface.selectAll('.midpoint')[0]).to.have.length(0);
|
||||
});
|
||||
|
||||
it("creates midpoint on extent edge for segment partially outside of the extent", function () {
|
||||
it('creates midpoint on extent edge for segment partially outside of the extent', function () {
|
||||
var a = iD.Node({loc: [50, 0]}),
|
||||
b = iD.Node({loc: [500, 0]}),
|
||||
line = iD.Way({nodes: [a.id, b.id]}),
|
||||
@@ -64,7 +64,7 @@ describe("iD.svg.Midpoints", function () {
|
||||
expect(surface.select('.midpoint').datum().loc).to.eql([100, 0]);
|
||||
});
|
||||
|
||||
it("doesn't create midpoint on extent edge for segment with pixel length less than 20", function () {
|
||||
it('doesn\'t create midpoint on extent edge for segment with pixel length less than 20', function () {
|
||||
var a = iD.Node({loc: [81, 0]}),
|
||||
b = iD.Node({loc: [500, 0]}),
|
||||
line = iD.Way({nodes: [a.id, b.id]}),
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
describe("iD.svg.Points", function () {
|
||||
describe('iD.svg.Points', function () {
|
||||
var surface,
|
||||
projection = Object,
|
||||
context;
|
||||
@@ -9,8 +9,8 @@ describe("iD.svg.Points", function () {
|
||||
.call(iD.svg.Layers(projection, context));
|
||||
});
|
||||
|
||||
it("adds tag classes", function () {
|
||||
var point = iD.Node({tags: {amenity: "cafe"}, loc: [0, 0]}),
|
||||
it('adds tag classes', function () {
|
||||
var point = iD.Node({tags: {amenity: 'cafe'}, loc: [0, 0]}),
|
||||
graph = iD.Graph([point]);
|
||||
|
||||
surface.call(iD.svg.Points(projection, context), graph, [point]);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
describe("iD.svg.TagClasses", function () {
|
||||
describe('iD.svg.TagClasses', function () {
|
||||
var selection;
|
||||
|
||||
beforeEach(function () {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
describe("iD.svg.Vertices", function () {
|
||||
describe('iD.svg.Vertices', function () {
|
||||
var surface,
|
||||
projection = Object,
|
||||
context;
|
||||
@@ -9,7 +9,7 @@ describe("iD.svg.Vertices", function () {
|
||||
.call(iD.svg.Layers(projection, context));
|
||||
});
|
||||
|
||||
it("adds the .shared class to vertices that are members of two or more ways", function () {
|
||||
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], tags: {highway: 'residential'}}),
|
||||
way2 = iD.Way({nodes: [node.id], tags: {highway: 'residential'}}),
|
||||
|
||||
Reference in New Issue
Block a user