mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Removing Delivered Notifications (#1305)
* completed * changelog * tests * more tests * better naming * fix * a bit more waiting time * generated mocks * xcodegen
This commit is contained in:
@@ -349,6 +349,27 @@ class RoomScreenViewModelTests: XCTestCase {
|
||||
await Task.yield()
|
||||
XCTAssert(roomProxyMock.cancelSendTransactionIDCallsCount == 0)
|
||||
}
|
||||
|
||||
func testMarkAsRead() async {
|
||||
// Setup
|
||||
let notificationCenterMock = NotificationCenterMock()
|
||||
let timelineController = MockRoomTimelineController()
|
||||
let roomProxyMock = RoomProxyMock(with: .init(displayName: ""))
|
||||
|
||||
let viewModel = RoomScreenViewModel(timelineController: timelineController,
|
||||
mediaProvider: MockMediaProvider(),
|
||||
roomProxy: roomProxyMock,
|
||||
appSettings: ServiceLocator.shared.settings,
|
||||
analytics: ServiceLocator.shared.analytics,
|
||||
userIndicatorController: userIndicatorControllerMock,
|
||||
notificationCenterProtocol: notificationCenterMock)
|
||||
|
||||
viewModel.context.send(viewAction: .markRoomAsRead)
|
||||
await Task.yield()
|
||||
XCTAssertEqual(notificationCenterMock.postNameObjectReceivedArguments?.aName, .roomMarkedAsRead)
|
||||
let roomID = notificationCenterMock.postNameObjectReceivedArguments?.anObject as? String
|
||||
XCTAssertEqual(roomID, roomProxyMock.id)
|
||||
}
|
||||
}
|
||||
|
||||
private extension TextRoomTimelineItem {
|
||||
|
||||
Reference in New Issue
Block a user