Extend coordinate rounding unit test

This commit is contained in:
Matthias Rupp 2023-05-07 05:24:04 -11:00
parent 1917542091
commit 6127d3f8f6

View file

@ -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);
});
});