Skip to content

Commit dcecafc

Browse files
Added additional tests
1 parent 28d4c68 commit dcecafc

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

Sources/StreamChatSwiftUI/ChatChannelList/ChatChannelSwipeableListItem.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ public struct ChatChannelSwipeableListItem<Factory: ViewFactory, ChannelListItem
3131

3232
/// minimum horizontal translation value necessary to open the side menu
3333
private let openTriggerValue: CGFloat = 60
34-
/// max horizontal translation value necessary to open the side menu
3534
private let maxTriggerValue: CGFloat = 300
3635
/// An additional value to add to the open menu width. This is useful if the cell has rounded corners.
3736
private let addWidthMargin: CGFloat = 5

StreamChatSwiftUITests/Tests/ChatChannelList/ChatChannelListView_Tests.swift

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,21 @@ class ChatChannelListView_Tests: StreamChatTestCase {
5555
assertSnapshot(matching: view, as: .image)
5656
}
5757

58+
func test_trailingSwipeActionsView_snapshot() {
59+
// Given
60+
let view = TrailingSwipeActionsView(
61+
channel: .mockDMChannel(),
62+
offsetX: 80,
63+
buttonWidth: 40,
64+
leftButtonTapped: { _ in },
65+
rightButtonTapped: { _ in }
66+
)
67+
.applyDefaultSize()
68+
69+
// Then
70+
assertSnapshot(matching: view, as: .image)
71+
}
72+
5873
private func makeChannelListController() -> ChatChannelListController_Mock {
5974
let channelListController = ChatChannelListController_Mock.mock(client: chatClient)
6075
channelListController.simulateInitial(channels: mockChannels(), state: .initialized)
Loading

0 commit comments

Comments
 (0)