fix ignored test

This commit is contained in:
Valere 2023-10-12 09:12:32 +02:00
parent 77a576784f
commit d4c141664b
3 changed files with 20 additions and 73 deletions

View File

@ -48,7 +48,6 @@ import kotlinx.coroutines.flow.flowOf
import org.amshove.kluent.shouldBeEqualTo
import org.junit.After
import org.junit.Before
import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
import org.matrix.android.sdk.api.session.crypto.crosssigning.DeviceTrustLevel
@ -129,34 +128,17 @@ class DevicesViewModelTest {
}
@Test
@Ignore
fun `given the viewModel when initializing it then verification listener is added`() {
// // Given
// val fakeVerificationService = givenVerificationService()
//
// // When
// val viewModel = createViewModel()
//
// // Then
// verify {
// fakeVerificationService.addListener(viewModel)
// }
}
// Given
val fakeVerificationService = givenVerificationService()
@Test
@Ignore
fun `given the viewModel when clearing it then verification listener is removed`() {
// // Given
// val fakeVerificationService = givenVerificationService()
//
// // When
// val viewModel = createViewModel()
// viewModel.onCleared()
//
// // Then
// verify {
// fakeVerificationService.removeListener(viewModel)
// }
// When
createViewModel()
// Then
verify {
fakeVerificationService.requestEventFlow()
}
}
@Test

View File

@ -38,12 +38,12 @@ import io.mockk.justRun
import io.mockk.mockk
import io.mockk.mockkStatic
import io.mockk.unmockkAll
import io.mockk.verify
import io.mockk.verifyAll
import kotlinx.coroutines.flow.flowOf
import org.amshove.kluent.shouldBeEqualTo
import org.junit.After
import org.junit.Before
import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
import org.matrix.android.sdk.api.session.homeserver.HomeServerCapabilities
@ -108,38 +108,20 @@ class OtherSessionsViewModelTest {
}
@Test
@Ignore
fun `given the viewModel when initializing it then verification listener is added`() {
// Given
// val fakeVerificationService = givenVerificationService()
// val devices = mockk<List<DeviceFullInfo>>()
// givenGetDeviceFullInfoListReturns(filterType = defaultArgs.defaultFilter, devices)
//
// // When
// val viewModel = createViewModel()
val fakeVerificationService = givenVerificationService()
.also { it.givenEventFlow() }
val devices = mockk<List<DeviceFullInfo>>()
givenGetDeviceFullInfoListReturns(filterType = defaultArgs.defaultFilter, devices)
// When
createViewModel()
// Then
// verify {
// fakeVerificationService.addListener(viewModel)
// }
}
@Test
@Ignore
fun `given the viewModel when clearing it then verification listener is removed`() {
// // Given
// val fakeVerificationService = givenVerificationService()
// val devices = mockk<List<DeviceFullInfo>>()
// givenGetDeviceFullInfoListReturns(filterType = defaultArgs.defaultFilter, devices)
//
// // When
// val viewModel = createViewModel()
// viewModel.onCleared()
//
// // Then
// verify {
// fakeVerificationService.removeListener(viewModel)
// }
verify {
fakeVerificationService.requestEventFlow()
}
}
@Test

View File

@ -48,7 +48,6 @@ import kotlinx.coroutines.flow.flowOf
import org.amshove.kluent.shouldBeEqualTo
import org.junit.After
import org.junit.Before
import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
import org.matrix.android.sdk.api.session.crypto.model.RoomEncryptionTrustLevel
@ -142,22 +141,6 @@ class SessionOverviewViewModelTest {
}
}
@Test
@Ignore
fun `given the viewModel when clearing it then verification listener is removed`() {
// // Given
// val fakeVerificationService = givenVerificationService()
//
// // When
// val viewModel = createViewModel()
// viewModel.onCleared()
//
// // Then
// verify {
// fakeVerificationService.removeListener(viewModel)
// }
}
@Test
fun `given the viewModel has been initialized then pushers are refreshed`() {
createViewModel()