mirror of
https://github.com/FoggedLens/iD.git
synced 2026-06-01 12:41:36 +02:00
Fix tests
This commit is contained in:
@@ -1,27 +1,27 @@
|
||||
describe('iD.BackgroundSource', function() {
|
||||
it('does not error with blank template', function() {
|
||||
var source = iD.BackgroundSource({ template: '' });
|
||||
expect(source([0,1,2])).to.equal('');
|
||||
expect(source.url([0,1,2])).to.equal('');
|
||||
});
|
||||
|
||||
it('generates a tile-generating source', function() {
|
||||
var source = iD.BackgroundSource({ template: '{z}/{x}/{y}' });
|
||||
expect(source([0,1,2])).to.equal('2/0/1');
|
||||
expect(source.url([0,1,2])).to.equal('2/0/1');
|
||||
});
|
||||
|
||||
it('supports subdomains', function() {
|
||||
var source = iD.BackgroundSource({ template: '{t}/{z}/{x}/{y}', subdomains: ['apples', 'oranges'] });
|
||||
expect(source([0,1,2])).to.equal('oranges/2/0/1');
|
||||
expect(source.url([0,1,2])).to.equal('oranges/2/0/1');
|
||||
});
|
||||
|
||||
it('distributes requests between subdomains', function() {
|
||||
var source = iD.BackgroundSource({ template: '{t}/{z}/{x}/{y}', subdomains: ['apples', 'oranges'] });
|
||||
expect(source([0,1,1])).to.equal('oranges/1/0/1');
|
||||
expect(source([0,2,1])).to.equal('apples/1/0/2');
|
||||
expect(source.url([0,1,1])).to.equal('oranges/1/0/1');
|
||||
expect(source.url([0,2,1])).to.equal('apples/1/0/2');
|
||||
});
|
||||
|
||||
it('supports josm style templates', function() {
|
||||
var source = iD.BackgroundSource({ template: '{switch:foo,bar}/{zoom}/{x}/{y}' });
|
||||
expect(source([0,1,1])).to.equal('bar/1/0/1');
|
||||
expect(source.url([0,1,1])).to.equal('bar/1/0/1');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -4,7 +4,6 @@ describe('iD.TileLayer', function() {
|
||||
beforeEach(function() {
|
||||
d = d3.select(document.createElement('div'));
|
||||
c = iD.TileLayer().projection(d3.geo.mercator());
|
||||
d.call(c);
|
||||
});
|
||||
|
||||
afterEach(function() {
|
||||
|
||||
Reference in New Issue
Block a user