Remove enums from tests

This commit is contained in:
Peter Robins
2016-06-03 07:38:15 +00:00
parent d51fecd827
commit 06fd92353b
41 changed files with 379 additions and 435 deletions
+6 -8
View File
@@ -91,7 +91,7 @@ describe('ol.geom.Circle', function() {
it('maintains Z coordinates', function() {
var circle = new ol.geom.Circle([0, 0, 1], 1);
expect(circle.getLayout()).to.be(ol.geom.GeometryLayout.XYZ);
expect(circle.getLayout()).to.be('XYZ');
var closestPoint = circle.getClosestPoint([2, 0]);
expect(closestPoint).to.have.length(3);
expect(closestPoint[0]).to.roughlyEqual(1, 1e-15);
@@ -101,7 +101,7 @@ describe('ol.geom.Circle', function() {
it('maintains M coordinates', function() {
var circle = new ol.geom.Circle([0, 0, 2], 1,
ol.geom.GeometryLayout.XYM);
'XYM');
var closestPoint = circle.getClosestPoint([2, 0]);
expect(closestPoint).to.have.length(3);
expect(closestPoint[0]).to.roughlyEqual(1, 1e-15);
@@ -111,7 +111,7 @@ describe('ol.geom.Circle', function() {
it('maintains Z and M coordinates', function() {
var circle = new ol.geom.Circle([0, 0, 1, 2], 1);
expect(circle.getLayout()).to.be(ol.geom.GeometryLayout.XYZM);
expect(circle.getLayout()).to.be('XYZM');
var closestPoint = circle.getClosestPoint([2, 0]);
expect(closestPoint).to.have.length(4);
expect(closestPoint[0]).to.roughlyEqual(1, 1e-15);
@@ -149,7 +149,7 @@ describe('ol.geom.Circle', function() {
describe('#getType', function() {
it('returns the expected value', function() {
expect(circle.getType()).to.be(ol.geom.GeometryType.CIRCLE);
expect(circle.getType()).to.be('Circle');
});
});
@@ -173,7 +173,7 @@ describe('ol.geom.Circle', function() {
describe('#setFlatCoordinates', function() {
it('sets both center and radius', function() {
circle.setFlatCoordinates(ol.geom.GeometryLayout.XY, [1, 2, 4, 2]);
circle.setFlatCoordinates('XY', [1, 2, 4, 2]);
expect(circle.getCenter()).to.eql([1, 2]);
expect(circle.getRadius()).to.be(3);
});
@@ -181,7 +181,7 @@ describe('ol.geom.Circle', function() {
it('fires a single change event', function() {
var spy = sinon.spy();
circle.on('change', spy);
circle.setFlatCoordinates(ol.geom.GeometryLayout.XY, [1, 2, 4, 2]);
circle.setFlatCoordinates('XY', [1, 2, 4, 2]);
expect(spy.calledOnce).to.be(true);
});
@@ -276,5 +276,3 @@ describe('ol.geom.Circle', function() {
goog.require('ol.geom.Circle');
goog.require('ol.geom.GeometryType');
goog.require('ol.geom.GeometryLayout');
+8 -9
View File
@@ -17,7 +17,7 @@ describe('ol.geom.LineString', function() {
});
it('defaults to layout XY', function() {
expect(lineString.getLayout()).to.be(ol.geom.GeometryLayout.XY);
expect(lineString.getLayout()).to.be('XY');
});
it('has empty coordinates', function() {
@@ -53,7 +53,7 @@ describe('ol.geom.LineString', function() {
});
it('has the expected layout', function() {
expect(lineString.getLayout()).to.be(ol.geom.GeometryLayout.XY);
expect(lineString.getLayout()).to.be('XY');
});
it('has the expected coordinates', function() {
@@ -114,7 +114,7 @@ describe('ol.geom.LineString', function() {
});
it('has the expected layout', function() {
expect(lineString.getLayout()).to.be(ol.geom.GeometryLayout.XYZ);
expect(lineString.getLayout()).to.be('XYZ');
});
it('has the expected coordinates', function() {
@@ -156,11 +156,11 @@ describe('ol.geom.LineString', function() {
var lineString;
beforeEach(function() {
lineString = new ol.geom.LineString(
[[1, 2, 3], [4, 5, 6]], ol.geom.GeometryLayout.XYM);
[[1, 2, 3], [4, 5, 6]], 'XYM');
});
it('has the expected layout', function() {
expect(lineString.getLayout()).to.be(ol.geom.GeometryLayout.XYM);
expect(lineString.getLayout()).to.be('XYM');
});
it('has the expected coordinates', function() {
@@ -205,7 +205,7 @@ describe('ol.geom.LineString', function() {
});
it('has the expected layout', function() {
expect(lineString.getLayout()).to.be(ol.geom.GeometryLayout.XYZM);
expect(lineString.getLayout()).to.be('XYZM');
});
it('has the expected coordinates', function() {
@@ -359,7 +359,7 @@ describe('ol.geom.LineString', function() {
var lineString;
beforeEach(function() {
lineString = new ol.geom.LineString(
[[1, 2, 3], [4, 5, 6]], ol.geom.GeometryLayout.XYM);
[[1, 2, 3], [4, 5, 6]], 'XYM');
});
describe('#getCoordinateAtM', function() {
@@ -405,7 +405,7 @@ describe('ol.geom.LineString', function() {
describe('#getCoordinateAtM', function() {
it('returns the expected value', function() {
expect(lineString.getLayout()).to.be(ol.geom.GeometryLayout.XYZM);
expect(lineString.getLayout()).to.be('XYZM');
var m;
for (m = 0; m <= 22; m += 0.5) {
expect(lineString.getCoordinateAtM(m, true)).to.eql(
@@ -421,5 +421,4 @@ describe('ol.geom.LineString', function() {
goog.require('ol.extent');
goog.require('ol.geom.GeometryLayout');
goog.require('ol.geom.LineString');
+8 -9
View File
@@ -17,7 +17,7 @@ describe('ol.geom.MultiLineString', function() {
});
it('defaults to layout XY', function() {
expect(multiLineString.getLayout()).to.be(ol.geom.GeometryLayout.XY);
expect(multiLineString.getLayout()).to.be('XY');
});
it('has empty coordinates', function() {
@@ -58,7 +58,7 @@ describe('ol.geom.MultiLineString', function() {
});
it('has the expected layout', function() {
expect(multiLineString.getLayout()).to.be(ol.geom.GeometryLayout.XY);
expect(multiLineString.getLayout()).to.be('XY');
});
it('has the expected coordinates', function() {
@@ -110,7 +110,7 @@ describe('ol.geom.MultiLineString', function() {
});
it('has the expected layout', function() {
expect(multiLineString.getLayout()).to.be(ol.geom.GeometryLayout.XYZ);
expect(multiLineString.getLayout()).to.be('XYZ');
});
it('has the expected coordinates', function() {
@@ -139,11 +139,11 @@ describe('ol.geom.MultiLineString', function() {
beforeEach(function() {
multiLineString = new ol.geom.MultiLineString(
[[[1, 2, 3], [4, 5, 6]], [[7, 8, 9], [10, 11, 12]]],
ol.geom.GeometryLayout.XYM);
'XYM');
});
it('has the expected layout', function() {
expect(multiLineString.getLayout()).to.be(ol.geom.GeometryLayout.XYM);
expect(multiLineString.getLayout()).to.be('XYM');
});
it('has the expected coordinates', function() {
@@ -167,11 +167,11 @@ describe('ol.geom.MultiLineString', function() {
it('can return individual line strings', function() {
var lineString0 = multiLineString.getLineString(0);
expect(lineString0).to.be.an(ol.geom.LineString);
expect(lineString0.getLayout()).to.be(ol.geom.GeometryLayout.XYM);
expect(lineString0.getLayout()).to.be('XYM');
expect(lineString0.getCoordinates()).to.eql([[1, 2, 3], [4, 5, 6]]);
var lineString1 = multiLineString.getLineString(1);
expect(lineString1).to.be.an(ol.geom.LineString);
expect(lineString1.getLayout()).to.be(ol.geom.GeometryLayout.XYM);
expect(lineString1.getLayout()).to.be('XYM');
expect(lineString1.getCoordinates()).to.eql([[7, 8, 9], [10, 11, 12]]);
});
@@ -290,7 +290,7 @@ describe('ol.geom.MultiLineString', function() {
});
it('has the expected layout', function() {
expect(multiLineString.getLayout()).to.be(ol.geom.GeometryLayout.XYZM);
expect(multiLineString.getLayout()).to.be('XYZM');
});
it('has the expected coordinates', function() {
@@ -333,6 +333,5 @@ describe('ol.geom.MultiLineString', function() {
goog.require('ol.extent');
goog.require('ol.geom.GeometryLayout');
goog.require('ol.geom.LineString');
goog.require('ol.geom.MultiLineString');
+10 -11
View File
@@ -17,7 +17,7 @@ describe('ol.geom.MultiPoint', function() {
});
it('defaults to layout XY', function() {
expect(multiPoint.getLayout()).to.be(ol.geom.GeometryLayout.XY);
expect(multiPoint.getLayout()).to.be('XY');
});
it('has empty coordinates', function() {
@@ -53,7 +53,7 @@ describe('ol.geom.MultiPoint', function() {
});
it('has the expected layout', function() {
expect(multiPoint.getLayout()).to.be(ol.geom.GeometryLayout.XY);
expect(multiPoint.getLayout()).to.be('XY');
});
it('has the expected coordinates', function() {
@@ -94,7 +94,7 @@ describe('ol.geom.MultiPoint', function() {
});
it('has the expected layout', function() {
expect(multiPoint.getLayout()).to.be(ol.geom.GeometryLayout.XYZ);
expect(multiPoint.getLayout()).to.be('XYZ');
});
it('has the expected coordinates', function() {
@@ -120,11 +120,11 @@ describe('ol.geom.MultiPoint', function() {
var multiPoint;
beforeEach(function() {
multiPoint = new ol.geom.MultiPoint(
[[1, 2, 3], [4, 5, 6]], ol.geom.GeometryLayout.XYM);
[[1, 2, 3], [4, 5, 6]], 'XYM');
});
it('has the expected layout', function() {
expect(multiPoint.getLayout()).to.be(ol.geom.GeometryLayout.XYM);
expect(multiPoint.getLayout()).to.be('XYM');
});
it('has the expected coordinates', function() {
@@ -145,10 +145,10 @@ describe('ol.geom.MultiPoint', function() {
it('can return individual points', function() {
var point0 = multiPoint.getPoint(0);
expect(point0.getLayout()).to.be(ol.geom.GeometryLayout.XYM);
expect(point0.getLayout()).to.be('XYM');
expect(point0.getCoordinates()).to.eql([1, 2, 3]);
var point1 = multiPoint.getPoint(1);
expect(point1.getLayout()).to.be(ol.geom.GeometryLayout.XYM);
expect(point1.getLayout()).to.be('XYM');
expect(point1.getCoordinates()).to.eql([4, 5, 6]);
});
@@ -156,10 +156,10 @@ describe('ol.geom.MultiPoint', function() {
var points = multiPoint.getPoints();
expect(points).to.have.length(2);
expect(points[0]).to.be.an(ol.geom.Point);
expect(points[0].getLayout()).to.be(ol.geom.GeometryLayout.XYM);
expect(points[0].getLayout()).to.be('XYM');
expect(points[0].getCoordinates()).to.eql([1, 2, 3]);
expect(points[1]).to.be.an(ol.geom.Point);
expect(points[1].getLayout()).to.be(ol.geom.GeometryLayout.XYM);
expect(points[1].getLayout()).to.be('XYM');
expect(points[1].getCoordinates()).to.eql([4, 5, 6]);
});
@@ -173,7 +173,7 @@ describe('ol.geom.MultiPoint', function() {
});
it('has the expected layout', function() {
expect(multiPoint.getLayout()).to.be(ol.geom.GeometryLayout.XYZM);
expect(multiPoint.getLayout()).to.be('XYZM');
});
it('has the expected coordinates', function() {
@@ -264,6 +264,5 @@ describe('ol.geom.MultiPoint', function() {
goog.require('ol.extent');
goog.require('ol.geom.GeometryLayout');
goog.require('ol.geom.MultiPoint');
goog.require('ol.geom.Point');
+4 -5
View File
@@ -17,7 +17,7 @@ describe('ol.geom.Point', function() {
});
it('has the expected layout', function() {
expect(point.getLayout()).to.be(ol.geom.GeometryLayout.XY);
expect(point.getLayout()).to.be('XY');
});
it('has the expected coordinates', function() {
@@ -50,11 +50,11 @@ describe('ol.geom.Point', function() {
var point;
beforeEach(function() {
point = new ol.geom.Point([1, 2, 3], ol.geom.GeometryLayout.XYM);
point = new ol.geom.Point([1, 2, 3], 'XYM');
});
it('has the expected layout', function() {
expect(point.getLayout()).to.be(ol.geom.GeometryLayout.XYM);
expect(point.getLayout()).to.be('XYM');
});
it('has the expected coordinates', function() {
@@ -91,7 +91,7 @@ describe('ol.geom.Point', function() {
});
it('has the expected layout', function() {
expect(point.getLayout()).to.be(ol.geom.GeometryLayout.XYZM);
expect(point.getLayout()).to.be('XYZM');
});
it('has the expected coordinates', function() {
@@ -194,5 +194,4 @@ describe('ol.geom.Point', function() {
goog.require('ol.extent');
goog.require('ol.geom.GeometryLayout');
goog.require('ol.geom.Point');
+7 -8
View File
@@ -17,7 +17,7 @@ describe('ol.geom.Polygon', function() {
});
it('defaults to layout XY', function() {
expect(polygon.getLayout()).to.be(ol.geom.GeometryLayout.XY);
expect(polygon.getLayout()).to.be('XY');
});
it('has empty coordinates', function() {
@@ -64,7 +64,7 @@ describe('ol.geom.Polygon', function() {
});
it('has the expected layout', function() {
expect(polygon.getLayout()).to.be(ol.geom.GeometryLayout.XY);
expect(polygon.getLayout()).to.be('XY');
});
it('has the expected coordinates', function() {
@@ -183,7 +183,7 @@ describe('ol.geom.Polygon', function() {
});
it('has the expected layout', function() {
expect(polygon.getLayout()).to.be(ol.geom.GeometryLayout.XYZ);
expect(polygon.getLayout()).to.be('XYZ');
});
it('has the expected coordinates', function() {
@@ -274,7 +274,7 @@ describe('ol.geom.Polygon', function() {
outerRing = [[0, 0, 1], [4, 4, 2], [4, 0, 3]];
innerRing = [[2, 1, 4], [3, 1, 5], [3, 2, 6]];
polygon = new ol.geom.Polygon(
[outerRing, innerRing], ol.geom.GeometryLayout.XYM);
[outerRing, innerRing], 'XYM');
flatCoordinates = [0, 0, 1, 4, 4, 2, 4, 0, 3, 2, 1, 4, 3, 1, 5, 3, 2, 6];
outsideOuter = [1, 3];
inside = [3.5, 0.5];
@@ -282,7 +282,7 @@ describe('ol.geom.Polygon', function() {
});
it('has the expected layout', function() {
expect(polygon.getLayout()).to.be(ol.geom.GeometryLayout.XYM);
expect(polygon.getLayout()).to.be('XYM');
});
it('has the expected coordinates', function() {
@@ -387,7 +387,7 @@ describe('ol.geom.Polygon', function() {
});
it('has the expected layout', function() {
expect(polygon.getLayout()).to.be(ol.geom.GeometryLayout.XYZM);
expect(polygon.getLayout()).to.be('XYZM');
});
it('has the expected coordinates', function() {
@@ -521,7 +521,7 @@ describe('ol.geom.Polygon', function() {
describe('ol.geom.Polygon.fromCircle', function() {
it('creates a regular polygon', function() {
var circle = new ol.geom.Circle([0, 0, 0], 1, ol.geom.GeometryLayout.XYZ);
var circle = new ol.geom.Circle([0, 0, 0], 1, 'XYZ');
var polygon = ol.geom.Polygon.fromCircle(circle);
var coordinates = polygon.getLinearRing(0).getCoordinates();
expect(coordinates[0].length).to.eql(3);
@@ -556,6 +556,5 @@ describe('ol.geom.Polygon', function() {
goog.require('ol.extent');
goog.require('ol.geom.Circle');
goog.require('ol.geom.GeometryLayout');
goog.require('ol.geom.LinearRing');
goog.require('ol.geom.Polygon');