Add setUrl tests

This commit is contained in:
Andreas Hocevar
2016-01-13 18:08:19 +01:00
parent 4b441dc503
commit 86c7f950d6
2 changed files with 11 additions and 0 deletions

View File

@@ -253,6 +253,9 @@ describe('ol.source.TileArcGISRest', function() {
var urls = source.getUrls();
expect(urls).to.eql(['http://test3.com/MapServer']);
var tileUrl = source.tileUrlFunction([0, 0, 0], 1, ol.proj.get('EPSG:4326'));
expect(tileUrl.indexOf(urls[0])).to.be(0);
});

View File

@@ -258,6 +258,14 @@ describe('ol.source.TileWMS', function() {
expect(uri.getFragment()).to.be.empty();
});
});
describe('#setUrl()', function() {
var source = new ol.source.TileWMS(options);
var url = 'http://foo/';
source.setUrl(url);
var tileUrl = source.tileUrlFunction([0, 0, 0], 1, ol.proj.get('EPSG:4326'));
expect(tileUrl.indexOf(url)).to.be(0);
});
});