Skip to content

Commit d72b634

Browse files
committed
update tests
1 parent 1d9a1a7 commit d72b634

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

test/osm_test.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -146,54 +146,54 @@ describe("L.OSM.DataLayer", function () {
146146
it("can be added to the map", function () {
147147
(new L.OSM.DataLayer(null, {asynchronous: true})).addTo(this.map);
148148
});
149-
149+
150150
it("creates a Polyline for a way", async function () {
151151
var osm = new L.OSM.DataLayer(fixture("way"), {asynchronous: true});
152152
await sleep(1);
153153
layers(osm).length.should.eq(21);
154154
layers(osm)[20].should.be.an.instanceof(L.Polyline);
155155
});
156-
156+
157157
it("creates a Polygon for an area", async function () {
158158
var osm = new L.OSM.DataLayer(fixture("area"), {asynchronous: true});
159159
await sleep(1);
160160
layers(osm).length.should.eq(15);
161161
layers(osm)[14].should.be.an.instanceof(L.Polygon);
162162
});
163-
163+
164164
it("creates a CircleMarker for an interesting node", async function () {
165165
var osm = new L.OSM.DataLayer(fixture("node"), {asynchronous: true});
166166
await sleep(1);
167167
layers(osm).length.should.eq(1);
168168
layers(osm)[0].should.be.an.instanceof(L.CircleMarker);
169169
});
170-
170+
171171
it("creates a Rectangle for a changeset", async function () {
172172
var osm = new L.OSM.DataLayer(fixture("changeset"), {asynchronous: true});
173173
await sleep(1);
174174
layers(osm).length.should.eq(1);
175175
layers(osm)[0].should.be.an.instanceof(L.Rectangle);
176176
});
177-
177+
178178
it("sets the feature property on a layer", async function () {
179179
var osm = new L.OSM.DataLayer(fixture("node"), {asynchronous: true});
180180
await sleep(1);
181181
layers(osm)[0].feature.should.have.property("type", "node");
182182
layers(osm)[0].feature.should.have.property("id", "356552551");
183183
});
184-
184+
185185
it("sets a way's style", async function () {
186186
var osm = new L.OSM.DataLayer(fixture("way"), {styles: {way: {color: "red"}}, asynchronous: true});
187187
await sleep(1);
188188
layers(osm)[20].options.should.have.property("color", "red");
189189
});
190-
190+
191191
it("sets an area's style", async function () {
192192
var osm = new L.OSM.DataLayer(fixture("area"), {styles: {area: {color: "green"}}, asynchronous: true});
193193
await sleep(1);
194194
layers(osm)[14].options.should.have.property("color", "green");
195195
});
196-
196+
197197
it("sets a node's style", async function () {
198198
var osm = new L.OSM.DataLayer(fixture("node"), {styles: {node: {color: "blue"}}, asynchronous: true});
199199
await sleep(1);
@@ -219,22 +219,22 @@ describe("L.OSM.DataLayer", function () {
219219
var layer = new L.OSM.DataLayer();
220220

221221
it("returns true when the node is not in any ways", function () {
222-
layer.interestingNode({}, [], []).should.be.true;
222+
layer.interestingNode({id: 1}, {}, {}).should.be.true;
223223
});
224224

225225
it("returns true when the node has an interesting tag", function () {
226-
var node = {tags: {interesting: true}};
227-
layer.interestingNode(node, [{nodes: [node]}], []).should.be.true;
226+
var node = {id: 1, tags: {interesting: true}};
227+
layer.interestingNode(node, {1: true}, {1: true}).should.be.true;
228228
});
229229

230230
it("returns false when the node is used in a way and has uninteresting tags", function () {
231-
var node = {tags: {source: 'who cares?'}};
232-
layer.interestingNode(node, [{nodes: [node]}], []).should.be.false;
231+
var node = {id: 1, tags: {source: 'who cares?'}};
232+
layer.interestingNode(node, {1: true}, {}).should.be.false;
233233
});
234234

235235
it("returns true when the node is used in a way and is used in a relation", function () {
236-
var node = {};
237-
layer.interestingNode(node, [{nodes: [node]}], [{members: [node]}]).should.be.true;
236+
var node = {id: 1};
237+
layer.interestingNode(node, {1: true}, {1: true}).should.be.true;
238238
});
239239
});
240240
});

0 commit comments

Comments
 (0)