Fix the domain switch test

This commit is contained in:
Bryan Housel
2020-03-13 13:11:56 -04:00
parent bdd02e5943
commit b96eccc67c

View File

@@ -5,10 +5,7 @@ describe('iD.rendererBackgroundSource', function() {
});
it('supports tms replacement tokens', function() {
var source = iD.rendererBackgroundSource({
type: 'tms',
template: '{z}/{x}/{y}'
});
var source = iD.rendererBackgroundSource({ type: 'tms', template: '{z}/{x}/{y}' });
expect(source.url([0,1,2])).to.equal('2/0/1');
});
@@ -35,12 +32,12 @@ describe('iD.rendererBackgroundSource', function() {
});
it('supports subdomains', function() {
var source = iD.rendererBackgroundSource({ template: '{switch:a,b}/{z}/{x}/{y}'});
var source = iD.rendererBackgroundSource({ type: 'tms', 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.rendererBackgroundSource({ template: '{switch:a,b}/{z}/{x}/{y}' });
var source = iD.rendererBackgroundSource({ type: 'tms', 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');
});