gatsby-starter-leaflet icon indicating copy to clipboard operation
gatsby-starter-leaflet copied to clipboard

Create tests using leaflet mock

Open colbyfayock opened this issue 6 years ago • 7 comments

Create some tests using the Leaflet mock under tests/__mocks__.

Particularly, can start with mocking out a map and testing functionality for promiseToZoomIn available in lib/map.

colbyfayock avatar Oct 13 '19 14:10 colbyfayock

Could be a nice way to brush up my testing skills, i'll give it a try :)

RonnyNovik avatar Oct 02 '21 17:10 RonnyNovik

sounds great!

colbyfayock avatar Oct 02 '21 22:10 colbyfayock

Unfortunately i cannot see the promiseToZoomIn func under lib/map.js, is it not merged to master yet?

RonnyNovik avatar Oct 04 '21 18:10 RonnyNovik

sorry about that! that must have changed since this isssue was created

want to do promiseToFlyTo? https://github.com/colbyfayock/gatsby-starter-leaflet/blob/d20d304fd1ee917055c4f083c7b1237dc8c26928/src/lib/map.js#L6

colbyfayock avatar Oct 04 '21 18:10 colbyfayock

Sure :)

RonnyNovik avatar Oct 04 '21 18:10 RonnyNovik

I already see that you have a unit test for this functionality in map.test.js, are you sure you also need a cypress test for that?

RonnyNovik avatar Oct 04 '21 18:10 RonnyNovik

if you think we're comfortably covered then we can close this out @RonnyNovik

apologies if thats the case, this Issue must just be stale then

happy to accept any other coverage if you find any thats needed between Jest and Cypress

colbyfayock avatar Oct 06 '21 00:10 colbyfayock