@@ -36,7 +36,8 @@ class MessageContainerView_Tests: StreamChatTestCase {
3636
3737 func test_messageContainerEdited_snapshot( ) {
3838 // Given
39- streamChat = StreamChat ( chatClient: chatClient)
39+ let utils = Utils ( dateFormatter: EmptyDateFormatter ( ) )
40+ streamChat = StreamChat ( chatClient: chatClient, utils: utils)
4041 let message = ChatMessage . mock (
4142 id: . unique,
4243 cid: . unique,
@@ -52,6 +53,52 @@ class MessageContainerView_Tests: StreamChatTestCase {
5253 // Then
5354 assertSnapshot ( matching: view, as: . image( perceptualPrecision: precision) )
5455 }
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+ }
55102
56103 func test_messageContainerViewSentOtherUser_snapshot( ) {
57104 // Given
0 commit comments