rdview-service
Version:
Rdview service for loading road photos
19 lines (16 loc) • 584 B
text/typescript
import { getClosestViewByCoords, getClosestViewByKm } from '../../src/utils';
import { views } from '../moqs/views';
describe('getClosestPhotoByCoords', () => {
it('should find photo when searching by photo coords', () => {
views.forEach(view => {
expect(getClosestViewByCoords(views, view.lat, view.lon)).toEqual(view);
});
});
});
describe('getClosestPhotoByKm', () => {
it('should find photo when searching by photo km', () => {
views.forEach(view => {
expect(getClosestViewByKm(views, view.rdKm)).toEqual(view);
});
});
});