Skip to content

Commit

Permalink
fixup! Retry logic for chat engagement
Browse files Browse the repository at this point in the history
Fix test target

MOB-3597
  • Loading branch information
Egor Egorov committed Sep 30, 2024
1 parent bc3a3f4 commit fd836eb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion GliaWidgetsTests/Lib/ChatItem/ChatItem+Equatable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ extension ChatItem.Kind: Equatable {
case (.queueOperator, .queueOperator):
return true

case (.outgoingMessage(let lhsMessage), .outgoingMessage(let rhsMessage)):
case (.outgoingMessage(let lhsMessage, _), .outgoingMessage(let rhsMessage, _)):
return lhsMessage.payload.messageId == rhsMessage.payload.messageId

case (.visitorMessage(let lhsMessage, _), .visitorMessage(let rhsMessage, _)):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class ChatViewModelTests: XCTestCase {
isCustomCardSupported: false,
isWindowVisible: .init(with: true),
startAction: .none,
deliveredStatusText: "Delivered",
deliveredStatusText: "Delivered",
failedToDeliverStatusText: "Failed",
chatType: .nonAuthenticated,
environment: .init(
fetchFile: { _, _, _ in },
Expand Down Expand Up @@ -744,7 +745,7 @@ class ChatViewModelTests: XCTestCase {

let outgoingMessage = OutgoingMessage(payload: .mock(messageIdSuffix: messageIdSuffix))
viewModel.pendingSection.append(
.init(kind: .outgoingMessage(outgoingMessage))
.init(kind: .outgoingMessage(outgoingMessage, error: nil))
)

viewModel.interactorEvent(.receivedMessage(.mock(id: outgoingMessage.payload.messageId.rawValue)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ extension ChatItem.Kind {
static func mock(kind: Internal) -> ChatItem.Kind {
switch kind {
case .queueOperator: return .queueOperator
case .outgoingMessage: return .outgoingMessage(.mock())
case .outgoingMessage: return .outgoingMessage(.mock(), error: nil)
case .visitorMessage: return .visitorMessage(.mock(), status: nil)
case .operatorMessage:
return .operatorMessage(
Expand Down

0 comments on commit fd836eb

Please sign in to comment.