Fix unit tests

This commit is contained in:
Maxime NATUREL 2023-02-23 10:15:34 +01:00
parent af4ab41851
commit f782a31592
2 changed files with 3 additions and 7 deletions

View file

@ -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,

View file

@ -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
}