Fix tests

This commit is contained in:
John Firebaugh
2013-08-22 14:15:33 -07:00
parent b5bd015cc2
commit c7363623ad
2 changed files with 6 additions and 7 deletions
+6 -6
View File
@@ -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');
});
});
-1
View File
@@ -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() {