From 5529345bf149229c6ecd3db3f82588b8a6b5402c Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 22 Aug 2024 10:35:19 +0100 Subject: [PATCH] Ensure consistent AggregatedReaction screenshots Different system locales can generate different screenshots, causing CI to be unhappy. Hardcoding a locale ensures the same date format is always used. Signed-off-by: Joe Groocock --- .../impl/timeline/model/AggregatedReactionProvider.kt | 4 ++-- ...eline.components.reactionsummary_SheetContent_Day_0_en.png | 4 ++-- ...ine.components.reactionsummary_SheetContent_Night_0_en.png | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/model/AggregatedReactionProvider.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/model/AggregatedReactionProvider.kt index 087de1753a..35baf24207 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/model/AggregatedReactionProvider.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/model/AggregatedReactionProvider.kt @@ -38,10 +38,10 @@ fun anAggregatedReaction( count: Int = 1, isHighlighted: Boolean = false, ): AggregatedReaction { + val timeFormatter = DateFormat.getTimeInstance(DateFormat.SHORT, java.util.Locale.US) + val date = Date(1_689_061_264L) val senders = buildList { repeat(count) { index -> - val timeFormatter = DateFormat.getTimeInstance(DateFormat.SHORT) - val date = Date(1_689_061_264L) add( AggregatedReactionSender( senderId = if (isHighlighted && index == 0) userId else UserId("@user$index:server.org"), diff --git a/tests/uitests/src/test/snapshots/images/features.messages.impl.timeline.components.reactionsummary_SheetContent_Day_0_en.png b/tests/uitests/src/test/snapshots/images/features.messages.impl.timeline.components.reactionsummary_SheetContent_Day_0_en.png index 3fdfe25ad2..d49c11a6a2 100644 --- a/tests/uitests/src/test/snapshots/images/features.messages.impl.timeline.components.reactionsummary_SheetContent_Day_0_en.png +++ b/tests/uitests/src/test/snapshots/images/features.messages.impl.timeline.components.reactionsummary_SheetContent_Day_0_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9490990c863318390d0f088ff82ad01a688c81cada63d749872b22b633fa12fe -size 23040 +oid sha256:65eb29b745fabe2587019c169a48a862b129a3ece30cf9bc82aff09c67878b35 +size 23180 diff --git a/tests/uitests/src/test/snapshots/images/features.messages.impl.timeline.components.reactionsummary_SheetContent_Night_0_en.png b/tests/uitests/src/test/snapshots/images/features.messages.impl.timeline.components.reactionsummary_SheetContent_Night_0_en.png index 1a24a720d8..df75d7f909 100644 --- a/tests/uitests/src/test/snapshots/images/features.messages.impl.timeline.components.reactionsummary_SheetContent_Night_0_en.png +++ b/tests/uitests/src/test/snapshots/images/features.messages.impl.timeline.components.reactionsummary_SheetContent_Night_0_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:730c2c5ab52209366611546dbdbbed62214f6f5e13328be66cce5f08d8f4f0e5 -size 23125 +oid sha256:c1cf0091d377d8018d14804433aaa67d1b0b510778b6f8a4e8a73faff2b4c782 +size 23280