Add tests for ol.coordinate.createStringXY().

This commit is contained in:
Marc Jansen
2014-07-01 16:25:56 +02:00
parent 07b41f84d0
commit 00fd5caa92

View File

@@ -47,6 +47,35 @@ describe('ol.coordinate', function() {
});
});
describe('#createStringXY', function() {
var coordinate,
created,
formatted;
beforeEach(function() {
coordinate = [6.6123, 46.7919];
created = null;
formatted = null;
});
it('returns a CoordinateFormatType', function() {
created = ol.coordinate.createStringXY();
expect(created).to.be.a('function');
formatted = created(coordinate);
expect(formatted).to.be.a('string');
expect(formatted).to.eql('7, 47');
});
it('respects opt_fractionDigits', function() {
created = ol.coordinate.createStringXY(3);
expect(created).to.be.a('function');
formatted = created(coordinate);
expect(formatted).to.be.a('string');
expect(formatted).to.eql('6.612, 46.792');
});
});
describe('#closestOnSegment', function() {
it('can handle points where the foot of the perpendicular is closest',
function() {