Permalink
Browse files

Initial tests for filter

  • Loading branch information...
1 parent e413281 commit 45af404f4bfdfc0ac89e7edd276c0a866e00ce1b @tschaub tschaub committed Jan 22, 2013
Showing with 46 additions and 0 deletions.
  1. +1 −0 test/ol.html
  2. +45 −0 test/spec/ol/filter/geometryfilter.test.js
View
@@ -81,6 +81,7 @@
<script type="text/javascript" src="spec/ol/resolutionconstraint.test.js"></script>
<script type="text/javascript" src="spec/ol/view2d.test.js"></script>
<script type="text/javascript" src="spec/ol/io/geojson.test.js"></script>
+ <script type="text/javascript" src="spec/ol/filter/geometryfilter.test.js"></script>
<script type="text/javascript" src="spec/ol/geom/multipoint.test.js"></script>
<script type="text/javascript" src="spec/ol/geom/multilinestring.test.js"></script>
<script type="text/javascript" src="spec/ol/geom/multipolygon.test.js"></script>
@@ -0,0 +1,45 @@
+describe('ol.filter.Geometry', function() {
+
+ describe('constructor', function() {
+ it('creates a new filter', function() {
+ var filter = new ol.filter.Geometry(ol.filter.GeometryType.POINT);
+ expect(filter).toBeA(ol.filter.Geometry);
+ });
+ });
+
+ describe('#getType()', function() {
+
+ it('works for point', function() {
+ var filter = new ol.filter.Geometry(ol.filter.GeometryType.POINT);
+ expect(filter.getType()).toBe(ol.filter.GeometryType.POINT);
+ });
+
+ it('works for linestring', function() {
+ var filter = new ol.filter.Geometry(ol.filter.GeometryType.LINESTRING);
+ expect(filter.getType()).toBe(ol.filter.GeometryType.LINESTRING);
+ });
+
+ it('works for polygon', function() {
+ var filter = new ol.filter.Geometry(ol.filter.GeometryType.POLYGON);
+ expect(filter.getType()).toBe(ol.filter.GeometryType.POLYGON);
+ });
+
+ it('works for multi-point', function() {
+ var filter = new ol.filter.Geometry(ol.filter.GeometryType.MULTIPOINT);
+ expect(filter.getType()).toBe(ol.filter.GeometryType.MULTIPOINT);
+ });
+
+ it('works for multi-linestring', function() {
+ var filter = new ol.filter.Geometry(
+ ol.filter.GeometryType.MULTILINESTRING);
+ expect(filter.getType()).toBe(ol.filter.GeometryType.MULTILINESTRING);
+ });
+
+ it('works for multi-polygon', function() {
+ var filter = new ol.filter.Geometry(ol.filter.GeometryType.MULTIPOLYGON);
+ expect(filter.getType()).toBe(ol.filter.GeometryType.MULTIPOLYGON);
+ });
+
+ });
+
+});

0 comments on commit 45af404

Please sign in to comment.