send .fullyRead marker when leaving the room

This commit is contained in:
Mauro Romito
2025-06-09 10:36:39 +02:00
committed by Mauro
parent 88a93fed5f
commit 53b92ad68f
2 changed files with 25 additions and 0 deletions

View File

@@ -248,6 +248,28 @@ class RoomScreenViewModelTests: XCTestCase {
XCTAssertTrue(viewModel.state.shouldShowCallButton)
}
func testRoomFullyRead() async {
let expectation = XCTestExpectation(description: "Wait for fully read")
let roomProxyMock = JoinedRoomProxyMock(.init(id: "MyRoomID"))
roomProxyMock.markAsReadReceiptTypeClosure = { readReceiptType in
XCTAssertEqual(readReceiptType, .fullyRead)
expectation.fulfill()
return .success(())
}
let viewModel = RoomScreenViewModel(clientProxy: ClientProxyMock(),
roomProxy: roomProxyMock,
initialSelectedPinnedEventID: nil,
mediaProvider: MediaProviderMock(configuration: .init()),
ongoingCallRoomIDPublisher: .init(.init(nil)),
appMediator: AppMediatorMock.default,
appSettings: ServiceLocator.shared.settings,
analyticsService: ServiceLocator.shared.analytics,
userIndicatorController: ServiceLocator.shared.userIndicatorController)
self.viewModel = viewModel
viewModel.stop()
await fulfillment(of: [expectation])
}
// MARK: - Knock Requests
func testKnockRequestBanner() async throws {