Fix Geo test cases
This commit is contained in:
parent
b7db9808b2
commit
4a9c5b627c
|
@ -22,14 +22,14 @@ describe('GeoPoint', function() {
|
||||||
describe('GeoPoint()', function() {
|
describe('GeoPoint()', function() {
|
||||||
it('Create from string', function() {
|
it('Create from string', function() {
|
||||||
var point = new GeoPoint('1.234,5.678');
|
var point = new GeoPoint('1.234,5.678');
|
||||||
assert.equal(point.lng, 1.234);
|
assert.equal(point.lat, 1.234);
|
||||||
assert.equal(point.lat, 5.678);
|
assert.equal(point.lng, 5.678);
|
||||||
var point2 = new GeoPoint('1.222, 5.333');
|
var point2 = new GeoPoint('1.222, 5.333');
|
||||||
assert.equal(point2.lng, 1.222);
|
assert.equal(point2.lat, 1.222);
|
||||||
assert.equal(point2.lat, 5.333);
|
assert.equal(point2.lng, 5.333);
|
||||||
var point3 = new GeoPoint('1.333, 5.111');
|
var point3 = new GeoPoint('1.333, 5.111');
|
||||||
assert.equal(point3.lng, 1.333);
|
assert.equal(point3.lat, 1.333);
|
||||||
assert.equal(point3.lat, 5.111);
|
assert.equal(point3.lng, 5.111);
|
||||||
});
|
});
|
||||||
it('Serialize as string', function() {
|
it('Serialize as string', function() {
|
||||||
var str = '1.234,5.678';
|
var str = '1.234,5.678';
|
||||||
|
@ -38,8 +38,8 @@ describe('GeoPoint', function() {
|
||||||
});
|
});
|
||||||
it('Create from array', function() {
|
it('Create from array', function() {
|
||||||
var point = new GeoPoint([5.555, 6.777]);
|
var point = new GeoPoint([5.555, 6.777]);
|
||||||
assert.equal(point.lng, 5.555);
|
assert.equal(point.lat, 5.555);
|
||||||
assert.equal(point.lat, 6.777);
|
assert.equal(point.lng, 6.777);
|
||||||
});
|
});
|
||||||
it('Create as Model property', function() {
|
it('Create as Model property', function() {
|
||||||
var Model = loopback.createModel('geo-model', {
|
var Model = loopback.createModel('geo-model', {
|
||||||
|
@ -51,8 +51,8 @@ describe('GeoPoint', function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
assert(m.geo instanceof GeoPoint);
|
assert(m.geo instanceof GeoPoint);
|
||||||
assert.equal(m.geo.lng, 1.222);
|
assert.equal(m.geo.lat, 1.222);
|
||||||
assert.equal(m.geo.lat, 3.444);
|
assert.equal(m.geo.lng, 3.444);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue