Skip to content

Commit

Permalink
Split very complex GlobeCoordinate test
Browse files Browse the repository at this point in the history
  • Loading branch information
thiemowmde authored and adrianheine committed Apr 7, 2016
1 parent e87b9ae commit 6d2b78c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/globeCoordinate/globeCoordinate.GlobeCoordinate.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@
var gc1Iso6709 = globeCoordinate.iso6709( this.getDecimal() ),
gc2Iso6709 = globeCoordinate.iso6709( otherGlobeCoordinate.getDecimal() );

return Math.abs( this.getPrecision() - otherGlobeCoordinate.getPrecision() ) < 0.00000001
return Math.abs( this._precision - otherGlobeCoordinate._precision ) < 0.00000001
&& gc1Iso6709 === gc2Iso6709
&& this.getGlobe() === otherGlobeCoordinate.getGlobe();
&& this._globe === otherGlobeCoordinate._globe;
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ define( [
QUnit.module( 'globeCoordinate.GlobeCoordinate.js' );

QUnit.test( 'Basic checks', function( assert ) {
assert.expect( 14 );
assert.expect( 13 );
var c;

assert.throws(
Expand Down Expand Up @@ -97,9 +97,11 @@ define( [
null,
'Verified precision is null'
);
} );

// test with custom globe
c = new globeCoordinate.GlobeCoordinate( {
QUnit.test( 'Costum globe', function( assert ) {
assert.expect( 2 );
var c = new globeCoordinate.GlobeCoordinate( {
latitude: 20,
longitude: 25.5,
globe: 'http://www.wikidata.org/entity/Q313'
Expand All @@ -111,6 +113,10 @@ define( [
'Verified getGlobe()'
);

assert.ok(
typeof c.getDecimal().globe === 'undefined',
'Verified getDecimal()'
);
} );

QUnit.test( 'Strict (in)equality', function( assert ) {
Expand Down

0 comments on commit 6d2b78c

Please sign in to comment.