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

View File

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

View File

@ -48,7 +48,6 @@ import kotlinx.coroutines.flow.flowOf
import org.amshove.kluent.shouldBeEqualTo import org.amshove.kluent.shouldBeEqualTo
import org.junit.After import org.junit.After
import org.junit.Before import org.junit.Before
import org.junit.Ignore
import org.junit.Rule import org.junit.Rule
import org.junit.Test import org.junit.Test
import org.matrix.android.sdk.api.session.crypto.model.RoomEncryptionTrustLevel 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 @Test
fun `given the viewModel has been initialized then pushers are refreshed`() { fun `given the viewModel has been initialized then pushers are refreshed`() {
createViewModel() createViewModel()