Case Study 1: Less Testable - Padded Bounding Box calculation (3rd party dep)
I have some code that determines a bounding box from some point coordinates. It's required that there be some padding in the resulting numbers, above and beyond what the geospatial library calculatess.
Currently there's a lot of thrash around getting this feature just right. Coincidentally (not), there is also an impoverished test suite (fault:
me).. But since the geospatial library requires a browser, our unit test runner
jest can't run it in the fast test suite. We haven't done any integration tests yet, unless our data-only e2e tests count. So, this feature is currently undertested, and it acts weird in that way that makes it feel 'hard to pin down'. There's been some churn on this.
To remedy this, we could completely refactor this to use a library for calculation that doesn't have a dependency on
window.H. Or I could limit what I test to the padding-adding calculation, trusting that the geospatial library has its ow