cashapp / paparazzi

Render your Android screens without a physical device or emulator
https://cashapp.github.io/paparazzi/
Apache License 2.0
2.24k stars 212 forks source link

Unify the code to get the path of a golden snapshot #1322

Open BraisGabin opened 5 months ago

BraisGabin commented 5 months ago

Righ now at paparazzi there are 3 different implementations to get the path of a golden snapshot. They are equivalent but their implementations are different. That makes them easy to unsync and that if you need that path in other places you need to reimplement it.

This PR fixes that moving all the logic to a single extension funcion and adding tests to avoid regressions (those paths didn't have any test).

The reason of this PR is because it is needed for #902 and #917. I assume that moving this to a separate PR will make it easier to review.