Files
openlayers/test/spec/ol/layer/vectortilelayer.test.js
Andreas Hocevar 6f5ed17fc5 Remove goog.asserts.*
This pull requests replaces type check hint assertions with type casts,
library sanity check assertions with conditional console.assert statements
in debug mode, and runtime sanity checks with assertions that throw an
ol.AssertionError with an error code for lookup outside the library.
2016-08-04 11:29:54 +02:00

62 lines
1.5 KiB
JavaScript

goog.provide('ol.test.layer.VectorTile');
describe('ol.layer.VectorTile', function() {
describe('constructor (defaults)', function() {
var layer;
beforeEach(function() {
layer = new ol.layer.VectorTile({
source: new ol.source.VectorTile({})
});
});
afterEach(function() {
layer.dispose();
});
it('creates an instance', function() {
expect(layer).to.be.a(ol.layer.VectorTile);
});
it('provides default preload', function() {
expect(layer.getPreload()).to.be(0);
});
it('provides default useInterimTilesOnError', function() {
expect(layer.getUseInterimTilesOnError()).to.be(true);
});
it('provides default renderMode', function() {
expect(layer.getRenderMode()).to.be('hybrid');
});
});
describe('constructor (options)', function() {
it('works with options', function() {
var layer = new ol.layer.VectorTile({
renderMode: 'vector',
source: new ol.source.VectorTile({})
});
expect(layer.getRenderMode()).to.be('vector');
layer = new ol.layer.VectorTile({
renderMode: 'image',
source: new ol.source.VectorTile({})
});
expect(layer.getRenderMode()).to.be('image');
expect(function() {
layer = new ol.layer.VectorTile({
renderMode: 'foo',
source: new ol.source.VectorTile({})
});
}).to.throwException();
});
});
});
goog.require('ol.layer.VectorTile');
goog.require('ol.source.VectorTile');