From a26f2a78eb4aeee062bc8bcdc955ba781a4020ec Mon Sep 17 00:00:00 2001 From: Marc Jansen Date: Tue, 7 Apr 2015 22:55:10 +0200 Subject: [PATCH 01/15] Add basic test for ol.binary.Buffer --- test/spec/ol/binary.test.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test/spec/ol/binary.test.js diff --git a/test/spec/ol/binary.test.js b/test/spec/ol/binary.test.js new file mode 100644 index 0000000000..5b7706f30a --- /dev/null +++ b/test/spec/ol/binary.test.js @@ -0,0 +1,16 @@ +goog.provide('ol.test.buffer'); + +describe('ol.binary.Buffer', function() { + + describe('constructor', function() { + + it('can be constructed without arguments', function() { + var instance = new ol.binary.Buffer(); + expect(instance).to.be.an(ol.binary.Buffer); + }); + + }); + +}); + +goog.require('ol.binary.Buffer'); From 29124a3dad26e014d235a940b76fb1322c32c48b Mon Sep 17 00:00:00 2001 From: Marc Jansen Date: Tue, 7 Apr 2015 22:55:54 +0200 Subject: [PATCH 02/15] Add basic test for ol.control.FullScreen --- test/spec/ol/control/fullscreencontrol.test.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test/spec/ol/control/fullscreencontrol.test.js diff --git a/test/spec/ol/control/fullscreencontrol.test.js b/test/spec/ol/control/fullscreencontrol.test.js new file mode 100644 index 0000000000..3429955b0b --- /dev/null +++ b/test/spec/ol/control/fullscreencontrol.test.js @@ -0,0 +1,16 @@ +goog.provide('ol.test.control.FullScreen'); + +describe('ol.control.FullScreen', function() { + + describe('constructor', function() { + + it('can be constructed without arguments', function() { + var instance = new ol.control.FullScreen(); + expect(instance).to.be.an(ol.control.FullScreen); + }); + + }); + +}); + +goog.require('ol.control.FullScreen'); From 479e723f0ef2e85dad997a807b71b3b8799f38ac Mon Sep 17 00:00:00 2001 From: Marc Jansen Date: Tue, 7 Apr 2015 22:56:18 +0200 Subject: [PATCH 03/15] Add basic test for ol.control.MousePosition --- .../spec/ol/control/mousepositioncontrol.test.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test/spec/ol/control/mousepositioncontrol.test.js diff --git a/test/spec/ol/control/mousepositioncontrol.test.js b/test/spec/ol/control/mousepositioncontrol.test.js new file mode 100644 index 0000000000..6409d2c12f --- /dev/null +++ b/test/spec/ol/control/mousepositioncontrol.test.js @@ -0,0 +1,16 @@ +goog.provide('ol.test.control.MousePosition'); + +describe('ol.control.MousePosition', function() { + + describe('constructor', function() { + + it('can be constructed without arguments', function() { + var instance = new ol.control.MousePosition(); + expect(instance).to.be.an(ol.control.MousePosition); + }); + + }); + +}); + +goog.require('ol.control.MousePosition'); From d14daa1938a017ea384d6b6e1d92bf07d935e951 Mon Sep 17 00:00:00 2001 From: Marc Jansen Date: Tue, 7 Apr 2015 22:56:37 +0200 Subject: [PATCH 04/15] Add basic test for ol.control.ScaleLine --- test/spec/ol/control/scalelinecontrol.test.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test/spec/ol/control/scalelinecontrol.test.js diff --git a/test/spec/ol/control/scalelinecontrol.test.js b/test/spec/ol/control/scalelinecontrol.test.js new file mode 100644 index 0000000000..2c6ead0006 --- /dev/null +++ b/test/spec/ol/control/scalelinecontrol.test.js @@ -0,0 +1,16 @@ +goog.provide('ol.test.control.ScaleLine'); + +describe('ol.control.ScaleLine', function() { + + describe('constructor', function() { + + it('can be constructed without arguments', function() { + var instance = new ol.control.ScaleLine(); + expect(instance).to.be.an(ol.control.ScaleLine); + }); + + }); + +}); + +goog.require('ol.control.ScaleLine'); From 481869bea69ec79eca40996e54c200ccb2aeb5ab Mon Sep 17 00:00:00 2001 From: Marc Jansen Date: Tue, 7 Apr 2015 22:57:01 +0200 Subject: [PATCH 05/15] Add basic test for ol.control.ZoomToExtent --- test/spec/ol/control/zoomtoextentcontrol.test.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test/spec/ol/control/zoomtoextentcontrol.test.js diff --git a/test/spec/ol/control/zoomtoextentcontrol.test.js b/test/spec/ol/control/zoomtoextentcontrol.test.js new file mode 100644 index 0000000000..33a3a769b5 --- /dev/null +++ b/test/spec/ol/control/zoomtoextentcontrol.test.js @@ -0,0 +1,16 @@ +goog.provide('ol.test.control.ZoomToExtent'); + +describe('ol.control.ZoomToExtent', function() { + + describe('constructor', function() { + + it('can be constructed without arguments', function() { + var instance = new ol.control.ZoomToExtent(); + expect(instance).to.be.an(ol.control.ZoomToExtent); + }); + + }); + +}); + +goog.require('ol.control.ZoomToExtent'); From 248d3071a341564033ab983786d25a57f52c0679 Mon Sep 17 00:00:00 2001 From: Marc Jansen Date: Tue, 7 Apr 2015 22:57:25 +0200 Subject: [PATCH 06/15] Add basic test for ol.DeviceOrientation --- test/spec/ol/deviceorientation.test.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test/spec/ol/deviceorientation.test.js diff --git a/test/spec/ol/deviceorientation.test.js b/test/spec/ol/deviceorientation.test.js new file mode 100644 index 0000000000..95bed8caf9 --- /dev/null +++ b/test/spec/ol/deviceorientation.test.js @@ -0,0 +1,16 @@ +goog.provide('ol.test.DeviceOrientation'); + +describe('ol.DeviceOrientation', function() { + + describe('constructor', function() { + + it('can be constructed without arguments', function() { + var instance = new ol.DeviceOrientation(); + expect(instance).to.be.an(ol.DeviceOrientation); + }); + + }); + +}); + +goog.require('ol.DeviceOrientation'); From 05f3f6852d27de3ea3769d0d2a869ab26aaaf32f Mon Sep 17 00:00:00 2001 From: Marc Jansen Date: Tue, 7 Apr 2015 23:03:25 +0200 Subject: [PATCH 07/15] Add basic test for ol.format.BinaryFeature --- test/spec/ol/format/binaryfeatureformat.test.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test/spec/ol/format/binaryfeatureformat.test.js diff --git a/test/spec/ol/format/binaryfeatureformat.test.js b/test/spec/ol/format/binaryfeatureformat.test.js new file mode 100644 index 0000000000..4201e1609e --- /dev/null +++ b/test/spec/ol/format/binaryfeatureformat.test.js @@ -0,0 +1,16 @@ +goog.provide('ol.test.format.BinaryFeature'); + +describe('ol.format.BinaryFeature', function() { + + describe('constructor', function() { + + it('can be constructed without arguments', function() { + var instance = new ol.format.BinaryFeature(); + expect(instance).to.be.an(ol.format.BinaryFeature); + }); + + }); + +}); + +goog.require('ol.format.BinaryFeature'); From bfefc0666b160965248a2b54314fb06e9f1723c6 Mon Sep 17 00:00:00 2001 From: Marc Jansen Date: Tue, 7 Apr 2015 23:06:28 +0200 Subject: [PATCH 08/15] Add basic test for ol.Geolocation --- test/spec/ol/geolocation.test.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test/spec/ol/geolocation.test.js diff --git a/test/spec/ol/geolocation.test.js b/test/spec/ol/geolocation.test.js new file mode 100644 index 0000000000..51994d14f4 --- /dev/null +++ b/test/spec/ol/geolocation.test.js @@ -0,0 +1,16 @@ +goog.provide('ol.test.Geolocation'); + +describe('ol.Geolocation', function() { + + describe('constructor', function() { + + it('can be constructed without arguments', function() { + var instance = new ol.Geolocation(); + expect(instance).to.be.an(ol.Geolocation); + }); + + }); + +}); + +goog.require('ol.Geolocation'); From 6d53a91e3a308d1eb22467cb9d758634d40dc319 Mon Sep 17 00:00:00 2001 From: Marc Jansen Date: Wed, 8 Apr 2015 14:32:21 +0200 Subject: [PATCH 09/15] Add tests for ol.ImageUrlFunction --- test/spec/ol/imageurlfunction.test.js | 101 ++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 test/spec/ol/imageurlfunction.test.js diff --git a/test/spec/ol/imageurlfunction.test.js b/test/spec/ol/imageurlfunction.test.js new file mode 100644 index 0000000000..646a6a9884 --- /dev/null +++ b/test/spec/ol/imageurlfunction.test.js @@ -0,0 +1,101 @@ +goog.provide('ol.test.ImageUrlFunction'); + +describe('ol.ImageUrlFunction', function() { + + describe('#createFromParamsFunction', function() { + + it('is a defined function', function() { + expect(ol.ImageUrlFunction.createFromParamsFunction).to.not.be(undefined); + expect(ol.ImageUrlFunction.createFromParamsFunction).to.be.a(Function); + }); + + it('returns a function that throws when called (no arguments)', function() { + var got = ol.ImageUrlFunction.createFromParamsFunction(); + expect(function() { + got(); + }).to.throwException(); + }); + + it('returns a function that doesn\'t throw when called (valid arguments)', + function() { + var baseUrl = 'foo', + params = {foo: 'bar'}, + paramsFunction = sinon.spy(), + got = ol.ImageUrlFunction.createFromParamsFunction(baseUrl, + params, paramsFunction); + + expect(function() { + got(); + }).to.not.throwException(); + } + ); + + it('passes given baseUrl to given paramsFunction', function() { + var baseUrl = 'foo', + params = {foo: 'bar'}, + spy = sinon.spy(), + got = ol.ImageUrlFunction.createFromParamsFunction(baseUrl, params, + spy); + + got(); + + expect(spy.called).to.be(true); + expect(spy.calledOnce).to.be(true); + expect(spy.calledWith(baseUrl)).to.be(true); + }); + + it('passes given params to given paramsFunction', function() { + var baseUrl = 'foo', + params = {foo: 'bar'}, + spy = sinon.spy(), + got = ol.ImageUrlFunction.createFromParamsFunction(baseUrl, params, + spy); + + got(); + + expect(spy.called).to.be(true); + expect(spy.calledOnce).to.be(true); + expect(spy.calledWith(baseUrl, params)).to.be(true); + }); + + it('passes five params to given paramsFunction', function() { + var baseUrl = 'foo', + params = {foo: 'bar'}, + extent = [1, 2, 3, 4], + size = [47, 11], + projection = ol.proj.get('CRS:84'), + spy = sinon.spy(), + firstArgs, + got = ol.ImageUrlFunction.createFromParamsFunction(baseUrl, params, + spy); + + got(extent, size, projection); + firstArgs = spy.args[0]; + + expect(spy.called).to.be(true); + expect(spy.calledOnce).to.be(true); + + expect(firstArgs.length).to.be(5); + expect(firstArgs).to.eql([baseUrl, params, extent, size, projection]); + }); + + }); + + describe('#nullImageUrlFunction', function() { + + it('is a defined function', function() { + expect(ol.ImageUrlFunction.nullImageUrlFunction).to.not.be(undefined); + expect(ol.ImageUrlFunction.nullImageUrlFunction).to.be.a(Function); + }); + + it('always returns undefined', function() { + var got = ol.ImageUrlFunction.nullImageUrlFunction(); + expect(got).to.be(undefined); + }); + + }); + +}); + +goog.require('ol.proj'); +goog.require('ol.ImageUrlFunction'); From 2609023a401747588f30d4ad4a728cc48bb681c0 Mon Sep 17 00:00:00 2001 From: Marc Jansen Date: Thu, 9 Apr 2015 08:49:58 +0200 Subject: [PATCH 10/15] Add basic test for ol.interaction.DragAndDrop --- .../interaction/draganddropinteraction.test.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test/spec/ol/interaction/draganddropinteraction.test.js diff --git a/test/spec/ol/interaction/draganddropinteraction.test.js b/test/spec/ol/interaction/draganddropinteraction.test.js new file mode 100644 index 0000000000..fcb847009f --- /dev/null +++ b/test/spec/ol/interaction/draganddropinteraction.test.js @@ -0,0 +1,16 @@ +goog.provide('ol.test.interaction.DragAndDrop'); + +describe('ol.interaction.DragAndDrop', function() { + + describe('constructor', function() { + + it('can be constructed without arguments', function() { + var instance = new ol.interaction.DragAndDrop(); + expect(instance).to.be.an(ol.interaction.DragAndDrop); + }); + + }); + +}); + +goog.require('ol.interaction.DragAndDrop'); From 3e4d6f0b029b951b8bd2448d9b1b4118af6ecb02 Mon Sep 17 00:00:00 2001 From: Marc Jansen Date: Thu, 9 Apr 2015 08:50:31 +0200 Subject: [PATCH 11/15] Add basic test for ol.interaction.DragRotateAndZoom --- .../dragrotateandzoominteraction.test.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test/spec/ol/interaction/dragrotateandzoominteraction.test.js diff --git a/test/spec/ol/interaction/dragrotateandzoominteraction.test.js b/test/spec/ol/interaction/dragrotateandzoominteraction.test.js new file mode 100644 index 0000000000..a426dd366d --- /dev/null +++ b/test/spec/ol/interaction/dragrotateandzoominteraction.test.js @@ -0,0 +1,16 @@ +goog.provide('ol.test.interaction.DragRotateAndZoom'); + +describe('ol.interaction.DragRotateAndZoom', function() { + + describe('constructor', function() { + + it('can be constructed without arguments', function() { + var instance = new ol.interaction.DragRotateAndZoom(); + expect(instance).to.be.an(ol.interaction.DragRotateAndZoom); + }); + + }); + +}); + +goog.require('ol.interaction.DragRotateAndZoom'); From e283d6f54a6454047b6a90026d7deb3388d84340 Mon Sep 17 00:00:00 2001 From: Marc Jansen Date: Thu, 9 Apr 2015 08:50:46 +0200 Subject: [PATCH 12/15] Add basic test for ol.interaction.Snap --- test/spec/ol/interaction/snapinteraction.test.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test/spec/ol/interaction/snapinteraction.test.js diff --git a/test/spec/ol/interaction/snapinteraction.test.js b/test/spec/ol/interaction/snapinteraction.test.js new file mode 100644 index 0000000000..5420431046 --- /dev/null +++ b/test/spec/ol/interaction/snapinteraction.test.js @@ -0,0 +1,16 @@ +goog.provide('ol.test.interaction.Snap'); + +describe('ol.interaction.Snap', function() { + + describe('constructor', function() { + + it('can be constructed without arguments', function() { + var instance = new ol.interaction.Snap(); + expect(instance).to.be.an(ol.interaction.Snap); + }); + + }); + +}); + +goog.require('ol.interaction.Snap'); From 33788ddfd9253213eca4d60b14ded13770cc6b77 Mon Sep 17 00:00:00 2001 From: Marc Jansen Date: Thu, 9 Apr 2015 08:52:08 +0200 Subject: [PATCH 13/15] Add basic test for ol.layer.Heatmap --- test/spec/ol/layer/heatmaplayer.test.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test/spec/ol/layer/heatmaplayer.test.js diff --git a/test/spec/ol/layer/heatmaplayer.test.js b/test/spec/ol/layer/heatmaplayer.test.js new file mode 100644 index 0000000000..129b46026d --- /dev/null +++ b/test/spec/ol/layer/heatmaplayer.test.js @@ -0,0 +1,16 @@ +goog.provide('ol.test.layer.Heatmap'); + +describe('ol.layer.Heatmap', function() { + + describe('constructor', function() { + + it('can be constructed without arguments', function() { + var instance = new ol.layer.Heatmap(); + expect(instance).to.be.an(ol.layer.Heatmap); + }); + + }); + +}); + +goog.require('ol.layer.Heatmap'); From b5c9f5e8b377d4f12d9dcfd2ee96640db1126bbc Mon Sep 17 00:00:00 2001 From: Marc Jansen Date: Fri, 10 Apr 2015 20:53:20 +0200 Subject: [PATCH 14/15] Add basic test for ol.Overlay --- test/spec/ol/overlay.test.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test/spec/ol/overlay.test.js diff --git a/test/spec/ol/overlay.test.js b/test/spec/ol/overlay.test.js new file mode 100644 index 0000000000..3f1f1e3790 --- /dev/null +++ b/test/spec/ol/overlay.test.js @@ -0,0 +1,16 @@ +goog.provide('ol.test.Overlay'); + +describe('ol.Overlay', function() { + + describe('constructor', function() { + + it('can be constructed with minimal arguments', function() { + var instance = new ol.Overlay({}); + expect(instance).to.be.an(ol.Overlay); + }); + + }); + +}); + +goog.require('ol.Overlay'); From eca09cba1dee42d0746cd44546ae79eac36cd970 Mon Sep 17 00:00:00 2001 From: Marc Jansen Date: Fri, 10 Apr 2015 21:03:58 +0200 Subject: [PATCH 15/15] Add basic test for ol.tilegrid.Zoomify --- test/spec/ol/tilegrid/zoomifytilegrid.test.js | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 test/spec/ol/tilegrid/zoomifytilegrid.test.js diff --git a/test/spec/ol/tilegrid/zoomifytilegrid.test.js b/test/spec/ol/tilegrid/zoomifytilegrid.test.js new file mode 100644 index 0000000000..4e3dace1c4 --- /dev/null +++ b/test/spec/ol/tilegrid/zoomifytilegrid.test.js @@ -0,0 +1,21 @@ +goog.provide('ol.test.tilegrid.Zoomify'); + +describe('ol.tilegrid.Zoomify', function() { + + describe('constructor', function() { + + it('can be constructed with minimal arguments', function() { + var instance = new ol.tilegrid.Zoomify({ + resolutions: [], + extent: [], + origin: [], + tileSize: [] + }); + expect(instance).to.be.an(ol.tilegrid.Zoomify); + }); + + }); + +}); + +goog.require('ol.tilegrid.Zoomify');