import React from 'react'; import ReactLeafletDriftMarker from 'react-leaflet-drift-marker'; import updateMarkers from './updateMarkers'; /** * Test the updateMarkers function by checking that the marker in 'toChangeMarkers' will accurately * find its corresponding marker in 'sourceMarkers' and adopt its position value. **/ test('updateMarkers Simple Test', () => { const toChangeMarkers = [ , ]; const sourceMarkers = [ , , ]; const changedMarkers = [ , ]; expect( updateMarkers(toChangeMarkers, sourceMarkers, 1).map( (e) => e.props.position ) ).toEqual(changedMarkers.map((e) => e.props.position)); }); /** * Test the updateMarkers function with a hash difference of 2 * by checking that the marker in 'toChangeMarkers' will accurately * find its corresponding marker in 'sourceMarkers' and adopt its position value. **/ test('updateMarkers Extensive Test', () => { const toChangeMarkers = [ , , , ]; const sourceMarkers = [ , , ]; const changedMarkers = [ , , , ]; expect( updateMarkers(toChangeMarkers, sourceMarkers, 2).map( (e) => e.props.position ) ).toEqual(changedMarkers.map((e) => e.props.position)); });