Skip to content

Commit 3a29ad6

Browse files
Added snapshot tests
1 parent 17e4521 commit 3a29ad6

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

StreamChatSwiftUITests/Tests/ChatChannel/MessageView_Tests.swift

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,4 +237,27 @@ class MessageView_Tests: StreamChatTestCase {
237237
// Then
238238
assertSnapshot(matching: view, as: .image)
239239
}
240+
241+
func test_linkAttachmentView_snapshot() {
242+
// Given
243+
let message = ChatMessage.mock(
244+
id: .unique,
245+
cid: .unique,
246+
text: "https://getstream.io",
247+
author: .mock(id: .unique)
248+
)
249+
250+
// When
251+
let view = LinkAttachmentContainer(
252+
factory: DefaultViewFactory.shared,
253+
message: message,
254+
width: defaultScreenSize.width,
255+
isFirst: true,
256+
scrolledId: .constant(nil)
257+
)
258+
.applyDefaultSize()
259+
260+
// Then
261+
assertSnapshot(matching: view, as: .image)
262+
}
240263
}

StreamChatSwiftUITests/Tests/ChatChannel/Suggestions/InstantCommandsHandler_Tests.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ class InstantCommandsHandler_Tests: StreamChatTestCase {
3232
in: typingSuggestion.text,
3333
caretLocation: typingSuggestion.locationRange.location
3434
)
35+
commandsHandler.handleCommand(
36+
for: .constant(typingSuggestion.text),
37+
selectedRangeLocation: .constant(typingSuggestion.locationRange.location),
38+
command: .constant(nil),
39+
extraData: [:]
40+
)
3541

3642
// Then
3743
XCTAssert(command != nil)
56.9 KB
Loading

0 commit comments

Comments
 (0)