Return null if the layer was not found in the WMTS capabilities

This commit is contained in:
Frederic Junod
2017-03-08 15:03:48 +01:00
parent cc13ca68fa
commit 2e22fce718
5 changed files with 23 additions and 8 deletions

View File

@@ -23,6 +23,14 @@ describe('ol.source.WMTS', function() {
});
});
it('returns null if the layer was not found in the capabilities', function() {
var options = ol.source.WMTS.optionsFromCapabilities(capabilities, {
layer: 'invalid'
});
expect(options).to.be(null);
});
it('can create KVP options from spec/ol/format/wmts/ogcsample.xml',
function() {
var options = ol.source.WMTS.optionsFromCapabilities(