diff --git a/GliaWidgets/Sources/Interactor/Interactor.swift b/GliaWidgets/Sources/Interactor/Interactor.swift index 000b3e14a..b7bdff6ab 100644 --- a/GliaWidgets/Sources/Interactor/Interactor.swift +++ b/GliaWidgets/Sources/Interactor/Interactor.swift @@ -384,7 +384,7 @@ extension Interactor: CoreSdkClient.Interactable { switch reason { case .visitorHungUp: state = .ended(.byVisitor) - case .operatorHungUp: + case .operatorHungUp, .followUp: state = .ended(.byOperator) case .error: state = .ended(.byError) diff --git a/GliaWidgetsTests/Sources/InteractorTests.swift b/GliaWidgetsTests/Sources/InteractorTests.swift index 0bd8a29b4..b1cceb131 100644 --- a/GliaWidgetsTests/Sources/InteractorTests.swift +++ b/GliaWidgetsTests/Sources/InteractorTests.swift @@ -395,7 +395,32 @@ class InteractorTests: XCTestCase { XCTAssertEqual(callbacks, [.ended]) } - + + func test_endWithFollowUpSetsStateToEnded() throws { + enum Callback: Equatable { + case ended + } + + var callbacks: [Callback] = [] + var interactorEnv = Interactor.Environment.failing + interactorEnv.gcd = .mock + let interactor = Interactor.mock(environment: interactorEnv) + interactor.addObserver(self) { event in + switch event { + case .stateChanged(let state): + if case .ended = state { + callbacks.append(.ended) + } + default: + return + } + } + + interactor.end(with: .followUp) + + XCTAssertEqual(callbacks, [.ended]) + } + func test_sendMessageCallsCoreSdkSendMessageWithAttachment() throws { enum Callback: Equatable { case sendMessageWithAttachment diff --git a/Podfile b/Podfile index 9476f89d6..49b4ff266 100644 --- a/Podfile +++ b/Podfile @@ -18,7 +18,7 @@ target 'TestingApp' do end target 'GliaWidgets' do - pod 'GliaCoreSDK', '2.0.4' + pod 'GliaCoreSDK' swiftlint end