mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-03-18 20:29:10 +03:00
Fix unit tests
This commit is contained in:
parent
af4ab41851
commit
f782a31592
2 changed files with 3 additions and 7 deletions
|
@ -62,7 +62,7 @@ internal class GetNotificationCountForSpacesUseCaseTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
fun `given space filter and hide invites when execute then correct notification count is returned`() = runTest {
|
||||
fun `given space filter and auto accept invites when execute then correct notification count is returned`() = runTest {
|
||||
// given
|
||||
val spaceFilter = SpaceFilter.NoFilter
|
||||
val pagedList = mockk<PagedList<RoomSummary>>()
|
||||
|
@ -78,7 +78,7 @@ internal class GetNotificationCountForSpacesUseCaseTest {
|
|||
fakeActiveSessionHolder.fakeSession
|
||||
.fakeRoomService
|
||||
.givenGetNotificationCountForRoomsReturns(expectedNotificationCount)
|
||||
fakeAutoAcceptInvites._hideInvites = true
|
||||
fakeAutoAcceptInvites._isEnabled = true
|
||||
|
||||
// When
|
||||
val testObserver = getNotificationCountForSpacesUseCase.execute(spaceFilter).test(this)
|
||||
|
@ -121,7 +121,7 @@ internal class GetNotificationCountForSpacesUseCaseTest {
|
|||
fakeActiveSessionHolder.fakeSession
|
||||
.fakeRoomService
|
||||
.givenGetRoomSummaries(invitedRooms)
|
||||
fakeAutoAcceptInvites._hideInvites = false
|
||||
fakeAutoAcceptInvites._isEnabled = false
|
||||
val expectedNotificationCount = RoomAggregateNotificationCount(
|
||||
notificationCount = notificationCount.notificationCount + invitedRooms.size,
|
||||
highlightCount = notificationCount.highlightCount + invitedRooms.size,
|
||||
|
|
|
@ -21,11 +21,7 @@ import im.vector.app.features.invite.AutoAcceptInvites
|
|||
class FakeAutoAcceptInvites : AutoAcceptInvites {
|
||||
|
||||
var _isEnabled: Boolean = false
|
||||
var _hideInvites: Boolean = false
|
||||
|
||||
override val isEnabled: Boolean
|
||||
get() = _isEnabled
|
||||
|
||||
override val hideInvites: Boolean
|
||||
get() = _hideInvites
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue