NYCPlanning / labs-applicantmaps

5 stars 5 forks source link

Implement new testing strategy #552

Closed allthesignals closed 5 years ago

allthesignals commented 5 years ago

Closes #549 by mocking/stubbing the mapbox-gl/composer/draw deps entirely

There are two refactors of source code that were necessary because the new testing strategy exposed some (race condition related) flaws:

  1. map form extracts the map resizing method calls into a separate function that's called as needed
  2. search handler component removes the bbl lookup component and accepts a markup block. bbl-lookup is passed into this block instead (for easier testability)

The rest of the changes are of course testing related

codecov[bot] commented 5 years ago

Codecov Report

Merging #552 into develop will decrease coverage by 1.41%. The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #552      +/-   ##
===========================================
- Coverage    86.89%   85.48%   -1.42%     
===========================================
  Files           74       74              
  Lines         1053     1054       +1     
===========================================
- Hits           915      901      -14     
- Misses         138      153      +15
Impacted Files Coverage Δ
app/components/map-form.js 95.83% <100%> (-2.07%) :arrow_down:
app/controllers/application.js 0% <0%> (-100%) :arrow_down:
app/components/search-handler.js 70% <0%> (-20%) :arrow_down:
app/components/project-geometries/modes/lots.js 93.87% <0%> (-6.13%) :arrow_down:
app/components/mapbox-gl-draw.js 77.41% <0%> (-3.23%) :arrow_down:
app/components/project-geometries/modes/draw.js 85.26% <0%> (-3.16%) :arrow_down:
app/models/geometric-property.js 97.61% <0%> (+2.38%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 5bbc4e1...c994d82. Read the comment docs.