Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hichamboushaba committed Dec 3, 2024
1 parent 5dc003f commit 8ea9816
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ class CardReaderConnectViewModelTest : BaseUnitTest() {
private val reader = mock<CardReader>().also { whenever(it.id).thenReturn("Dummy1") }
private val reader2 = mock<CardReader>().also { whenever(it.id).thenReturn("Dummy2") }
private val locationRepository: CardReaderLocationRepository = mock()
private val developerOptionsRepository: DeveloperOptionsRepository = mock()
private val developerOptionsRepository: DeveloperOptionsRepository = mock {
on { getUpdateSimulatedReaderOption() } doReturn CardReaderManager.SimulatorUpdateFrequency.RANDOM
}
private val siteModel: SiteModel = mock()
private val selectedSite: SelectedSite = mock {
on { getIfExists() }.thenReturn(siteModel)
Expand All @@ -116,11 +118,6 @@ class CardReaderConnectViewModelTest : BaseUnitTest() {
@Before
fun setUp() = testBlocking {
viewModel = initVM()
whenever(
appPrefs.selectedUpdateReaderOption()
).thenReturn(
DeveloperOptionsViewModel.DeveloperOptionsViewState.UpdateFrequencyUiModel.RANDOM.name
)
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,7 @@ class DeveloperOptionsViewModelTest : BaseUnitTest() {
}

assertThat(simulatedReaderRow).isNotNull
}

@Test
fun `when dev options screen accessed, then enable simulated reader icon is displayed`() {
val simulatedReaderRow = captureViewState()?.rows?.find {
it.icon == R.drawable.img_card_reader_connecting
}

assertThat(simulatedReaderRow).isNotNull
assertThat(simulatedReaderRow?.icon).isEqualTo(R.drawable.img_card_reader)
}

@Test
Expand Down

0 comments on commit 8ea9816

Please sign in to comment.