Extend coordinate rounding unit test
This commit is contained in:
parent
1917542091
commit
6127d3f8f6
1 changed files with 4 additions and 1 deletions
|
@ -1,7 +1,7 @@
|
|||
import { roundToDecimals } from './coordinate.util';
|
||||
|
||||
describe('Coordinate utils roundToDecimals test', () => {
|
||||
it('should round latitude and longitude to 5', () => {
|
||||
it('should round latitude and longitude to 5 digits', () => {
|
||||
const lat = 49.533547;
|
||||
const lon = 10.703075;
|
||||
|
||||
|
@ -10,5 +10,8 @@ describe('Coordinate utils roundToDecimals test', () => {
|
|||
|
||||
expect(latRounded).toBeCloseTo(lat, 4);
|
||||
expect(lonRounded).toBeCloseTo(lon, 4);
|
||||
|
||||
expect(`${latRounded}`.split('.')[1]).toHaveLength(5);
|
||||
expect(`${lonRounded}`.split('.')[1]).toHaveLength(5);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue