@@ -8,6 +8,14 @@ import SnapshotTesting
8
8
import XCTest
9
9
10
10
class MessageComposerView_Tests : StreamChatTestCase {
11
+
12
+ override func setUp( ) {
13
+ super. setUp ( )
14
+ let utils = Utils (
15
+ messageListConfig: MessageListConfig ( becomesFirstResponderOnOpen: true )
16
+ )
17
+ streamChat = StreamChat ( chatClient: chatClient, utils: utils)
18
+ }
11
19
12
20
func test_messageComposerView_snapshot( ) {
13
21
// Given
@@ -84,4 +92,33 @@ class MessageComposerView_Tests: StreamChatTestCase {
84
92
// Then
85
93
assertSnapshot ( matching: view, as: . image)
86
94
}
95
+
96
+ func test_composerInputView_inputTextView( ) {
97
+ // Given
98
+ let view = InputTextView (
99
+ frame: . init( x: 16 , y: 16 , width: defaultScreenSize. width - 32 , height: 50 )
100
+ )
101
+
102
+ // When
103
+ view. text = " This is a sample text "
104
+ view. selectedRange. location = 3
105
+
106
+ // Then
107
+ assertSnapshot ( matching: view, as: . image)
108
+ }
109
+
110
+ func test_composerInputView_composerInputTextView( ) {
111
+ // Given
112
+ let view = ComposerTextInputView (
113
+ text: . constant( " This is a sample text " ) ,
114
+ height: . constant( 38 ) ,
115
+ selectedRangeLocation: . constant( 3 ) ,
116
+ placeholder: " Send a message " ,
117
+ editable: true
118
+ )
119
+ . frame ( width: defaultScreenSize. width, height: 50 )
120
+
121
+ // Then
122
+ assertSnapshot ( matching: view, as: . image)
123
+ }
87
124
}
0 commit comments