mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 09:12:52 +00:00
Fix tests
This commit is contained in:
@@ -10,18 +10,13 @@ describe('iD.BackgroundSource', function() {
|
||||
});
|
||||
|
||||
it('supports subdomains', function() {
|
||||
var source = iD.BackgroundSource({ template: '{t}/{z}/{x}/{y}', subdomains: ['apples', 'oranges'] });
|
||||
expect(source.url([0,1,2])).to.equal('oranges/2/0/1');
|
||||
var source = iD.BackgroundSource({ template: '{switch:a,b}/{z}/{x}/{y}'});
|
||||
expect(source.url([0,1,2])).to.equal('b/2/0/1');
|
||||
});
|
||||
|
||||
it('distributes requests between subdomains', function() {
|
||||
var source = iD.BackgroundSource({ template: '{t}/{z}/{x}/{y}', subdomains: ['apples', 'oranges'] });
|
||||
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.url([0,1,1])).to.equal('bar/1/0/1');
|
||||
var source = iD.BackgroundSource({ template: '{switch:a,b}/{z}/{x}/{y}' });
|
||||
expect(source.url([0,1,1])).to.equal('b/1/0/1');
|
||||
expect(source.url([0,2,1])).to.equal('a/1/0/2');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user