Lanes forward backward tests

This commit is contained in:
Kushan Joshi
2016-06-13 18:45:55 +05:30
committed by Bryan Housel
parent 07827e5a2d
commit aa829ddf4d

View File

@@ -554,7 +554,7 @@ describe('iD.Way', function() {
});
});
describe.only("iD.Lanes", function() {
describe("iD.Lanes", function() {
describe("default lane tags", function() {
@@ -754,5 +754,41 @@ describe('iD.Way', function() {
});
});
});
describe.only("tagged", function() {
it("correctly returns oneway when tagged as oneway", function() {
expect(iD.Way({tags: { highway: 'residential', oneway: 'yes' }}).lanes().tagged.oneway, 'service lanes')
.to.eql('yes');
expect(iD.Way({tags: { highway: 'residential', oneway: 'no' }}).lanes().tagged.oneway, 'service lanes')
.to.eql('no');
});
it("correctly returns lane count", function() {
expect(iD.Way({tags: { highway: 'residential', oneway: 'yes', lanes: 4 }}).lanes().tagged.lanes, 'service lanes')
.to.eql({ count: 4 });
expect(iD.Way({tags: { highway: 'path', lanes: 1 }}).lanes().tagged.lanes, 'service lanes')
.to.eql({ count: 1 });
});
it("correctly returns the lane:forward and lane:backward count", function() {
expect(iD.Way({tags: { highway: 'residential', lanes: 2, 'lanes:forward': 1, 'lanes:backward': 1 }}).lanes().tagged.lanes, 'residential lanes')
.to.eql({
count: 2,
forward: 1,
backward: 1
});
expect(iD.Way({tags: { highway: 'trunk', lanes: 2, oneway: 'yes' }}).lanes().tagged.lanes, 'trunk lanes')
.to.eql({
count: 2
});
expect(iD.Way({tags: { highway: 'primary', lanes: 4, 'lanes:backward': 3, 'lanes:forward': 1 }}).lanes().tagged.lanes, 'primary lanes')
.to.eql({
count: 4,
backward: 3,
forward: 1
});
});
});
});
});