@@ -36,7 +36,8 @@ class MessageContainerView_Tests: StreamChatTestCase {
36
36
37
37
func test_messageContainerEdited_snapshot( ) {
38
38
// Given
39
- streamChat = StreamChat ( chatClient: chatClient)
39
+ let utils = Utils ( dateFormatter: EmptyDateFormatter ( ) )
40
+ streamChat = StreamChat ( chatClient: chatClient, utils: utils)
40
41
let message = ChatMessage . mock (
41
42
id: . unique,
42
43
cid: . unique,
@@ -52,6 +53,52 @@ class MessageContainerView_Tests: StreamChatTestCase {
52
53
// Then
53
54
assertSnapshot ( matching: view, as: . image( perceptualPrecision: precision) )
54
55
}
56
+
57
+ func test_messageContainerCurrentUserColor_snapshot( ) {
58
+ // Given
59
+ let utils = Utils ( dateFormatter: EmptyDateFormatter ( ) )
60
+ var colors = ColorPalette ( )
61
+ colors. messageCurrentUserTextColor = . red
62
+ let appearance = Appearance ( colors: colors)
63
+ streamChat = StreamChat ( chatClient: chatClient, appearance: appearance, utils: utils)
64
+ let message = ChatMessage . mock (
65
+ id: . unique,
66
+ cid: . unique,
67
+ text: " Message sent by current user " ,
68
+ author: . mock( id: Self . currentUserId, name: " Martin " ) ,
69
+ isSentByCurrentUser: true ,
70
+ textUpdatedAt: Date ( )
71
+ )
72
+
73
+ // When
74
+ let view = testMessageViewContainer ( message: message)
75
+
76
+ // Then
77
+ assertSnapshot ( matching: view, as: . image( perceptualPrecision: precision) )
78
+ }
79
+
80
+ func test_messageContainerOtherUserColor_snapshot( ) {
81
+ // Given
82
+ let utils = Utils ( dateFormatter: EmptyDateFormatter ( ) )
83
+ var colors = ColorPalette ( )
84
+ colors. messageOtherUserTextColor = . red
85
+ let appearance = Appearance ( colors: colors)
86
+ streamChat = StreamChat ( chatClient: chatClient, appearance: appearance, utils: utils)
87
+ let message = ChatMessage . mock (
88
+ id: . unique,
89
+ cid: . unique,
90
+ text: " Message sent by other user " ,
91
+ author: . mock( id: Self . currentUserId, name: " Martin " ) ,
92
+ isSentByCurrentUser: false ,
93
+ textUpdatedAt: Date ( )
94
+ )
95
+
96
+ // When
97
+ let view = testMessageViewContainer ( message: message)
98
+
99
+ // Then
100
+ assertSnapshot ( matching: view, as: . image( perceptualPrecision: precision) )
101
+ }
55
102
56
103
func test_messageContainerViewSentOtherUser_snapshot( ) {
57
104
// Given
0 commit comments