@@ -67,4 +67,96 @@ class MessageView_Tests: XCTestCase {
67
67
// Then
68
68
assertSnapshot ( matching: view, as: . image)
69
69
}
70
+
71
+ func test_messageViewGiphy_snapshot( ) {
72
+ // Given
73
+ let giphyMessage = ChatMessage . mock (
74
+ id: . unique,
75
+ cid: . unique,
76
+ text: " " ,
77
+ author: . mock( id: . unique) ,
78
+ attachments: ChatChannelTestHelpers . giphyAttachments
79
+ )
80
+
81
+ // When
82
+ let view = MessageView (
83
+ factory: DefaultViewFactory . shared,
84
+ message: giphyMessage,
85
+ contentWidth: defaultScreenSize. width,
86
+ isFirst: true
87
+ )
88
+ . frame ( width: defaultScreenSize. width, height: defaultScreenSize. height)
89
+
90
+ // Then
91
+ assertSnapshot ( matching: view, as: . image)
92
+ }
93
+
94
+ func test_messageViewLink_snapshot( ) {
95
+ // Given
96
+ let linkMessage = ChatMessage . mock (
97
+ id: . unique,
98
+ cid: . unique,
99
+ text: " " ,
100
+ author: . mock( id: . unique) ,
101
+ attachments: ChatChannelTestHelpers . linkAttachments
102
+ )
103
+
104
+ // When
105
+ let view = MessageView (
106
+ factory: DefaultViewFactory . shared,
107
+ message: linkMessage,
108
+ contentWidth: defaultScreenSize. width,
109
+ isFirst: true
110
+ )
111
+ . frame ( width: defaultScreenSize. width, height: defaultScreenSize. height)
112
+
113
+ // Then
114
+ assertSnapshot ( matching: view, as: . image)
115
+ }
116
+
117
+ func test_messageViewVideo_snapshot( ) {
118
+ // Given
119
+ let videoMessage = ChatMessage . mock (
120
+ id: . unique,
121
+ cid: . unique,
122
+ text: " " ,
123
+ author: . mock( id: . unique) ,
124
+ attachments: ChatChannelTestHelpers . videoAttachments
125
+ )
126
+
127
+ // When
128
+ let view = MessageView (
129
+ factory: DefaultViewFactory . shared,
130
+ message: videoMessage,
131
+ contentWidth: defaultScreenSize. width,
132
+ isFirst: true
133
+ )
134
+ . frame ( width: defaultScreenSize. width, height: defaultScreenSize. height)
135
+
136
+ // Then
137
+ assertSnapshot ( matching: view, as: . image)
138
+ }
139
+
140
+ func test_messageViewFile_snapshot( ) {
141
+ // Given
142
+ let fileMessage = ChatMessage . mock (
143
+ id: . unique,
144
+ cid: . unique,
145
+ text: " " ,
146
+ author: . mock( id: . unique) ,
147
+ attachments: ChatChannelTestHelpers . fileAttachments
148
+ )
149
+
150
+ // When
151
+ let view = MessageView (
152
+ factory: DefaultViewFactory . shared,
153
+ message: fileMessage,
154
+ contentWidth: defaultScreenSize. width,
155
+ isFirst: true
156
+ )
157
+ . frame ( width: defaultScreenSize. width, height: defaultScreenSize. height)
158
+
159
+ // Then
160
+ assertSnapshot ( matching: view, as: . image)
161
+ }
70
162
}
0 commit comments