I'm setting up Compose Preview Screenshot Testing, I have a composable with a date that's formatted with
java.time.format.DateTimeFormatter
, more specifically using
Locale.getDefault()
.
When I generate the reference screenshots on my local machine the locale formats dates in
DD.M.YYYY
. However, when I run tests on my CI machine it uses the
M/DD/YYYY
format. This causes the tests to fail, as now the screenshots look different.
What would be a recommended way to go about this? Of course, providing a Locale as an argument to the Composable would be one option, but I'm wondering if there's a more graceful approach.