From 34fa20f5c1fe2b22e372a93f706226f3be41aea8 Mon Sep 17 00:00:00 2001 From: Rasmus Tauts Date: Tue, 3 Oct 2023 16:04:20 +0300 Subject: [PATCH] fixup! Display Live Observation alert before normal engagement This PR displays Live Observation confirmation alert before normal engagement. This alert can't be skipped and needs visitor's manual confirmation to enqueue. MOB-2678 --- .../Sources/ChatViewModel/ChatViewModelTests+Gva.swift | 3 +-- .../Sources/ChatViewModel/ChatViewModelTests.swift | 1 + GliaWidgetsTests/Sources/InteractorTests.swift | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/GliaWidgetsTests/Sources/ChatViewModel/ChatViewModelTests+Gva.swift b/GliaWidgetsTests/Sources/ChatViewModel/ChatViewModelTests+Gva.swift index 805b1dbdc..5fbd31675 100644 --- a/GliaWidgetsTests/Sources/ChatViewModel/ChatViewModelTests+Gva.swift +++ b/GliaWidgetsTests/Sources/ChatViewModel/ChatViewModelTests+Gva.swift @@ -89,9 +89,8 @@ extension ChatViewModelTests { env.createFileUploadListModel = { _ in .mock() } env.createSendMessagePayload = { _, _ in .mock() } viewModel = .mock(interactor: interactorMock, environment: env) - viewModel.gvaOptionAction(for: option)() - + viewModel.interactor.state = .enqueueing XCTAssertEqual(interactorMock.state, .enqueueing) } diff --git a/GliaWidgetsTests/Sources/ChatViewModel/ChatViewModelTests.swift b/GliaWidgetsTests/Sources/ChatViewModel/ChatViewModelTests.swift index 64593b0a2..8bd1301f5 100644 --- a/GliaWidgetsTests/Sources/ChatViewModel/ChatViewModelTests.swift +++ b/GliaWidgetsTests/Sources/ChatViewModel/ChatViewModelTests.swift @@ -135,6 +135,7 @@ class ChatViewModelTests: XCTestCase { viewModelEnv.loadChatMessagesFromHistory = { true } let viewModel = ChatViewModel.mock(interactor: interactor, environment: viewModelEnv) viewModel.start() + viewModel.enqueue(mediaType: .audio) XCTAssertEqual(calls, [.configureWithInteractor, .configureWithConfiguration]) } diff --git a/GliaWidgetsTests/Sources/InteractorTests.swift b/GliaWidgetsTests/Sources/InteractorTests.swift index 887f719f3..14d0f6fde 100644 --- a/GliaWidgetsTests/Sources/InteractorTests.swift +++ b/GliaWidgetsTests/Sources/InteractorTests.swift @@ -173,7 +173,7 @@ class InteractorTests: XCTestCase { return } } - + interactor.state = .enqueueing interactor.enqueueForEngagement( mediaType: .text, success: {}, @@ -208,6 +208,7 @@ class InteractorTests: XCTestCase { } } + interactor.state = .enqueued(.mock) interactor.enqueueForEngagement( mediaType: .text, success: {},