Skip to content

Commit

Permalink
Fix the BreedViewModelTest to be compatible with non-nullable state m…
Browse files Browse the repository at this point in the history
…embers
  • Loading branch information
bpedryc committed Jun 15, 2023
1 parent 14d7b62 commit 7b6ea4c
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class BreedViewModelTest {
private val breedViewStateSuccessFavorite = BreedViewState(
breeds = listOf(appenzeller, australianLike)
)
private val breedNames = breedViewStateSuccessNoFavorite.breeds?.map { it.name }.orEmpty()
private val breedNames = breedViewStateSuccessNoFavorite.breeds.map { it.name }
}

@BeforeTest
Expand Down Expand Up @@ -106,7 +106,7 @@ class BreedViewModelTest {
viewModel.refreshBreeds().join()
// id is 5 here because it incremented twice when trying to insert duplicate breeds
assertEquals(
BreedViewState(breedViewStateSuccessFavorite.breeds?.plus(Breed(5, "extra", false))),
BreedViewState(breedViewStateSuccessFavorite.breeds.plus(Breed(5, "extra", false))),
awaitItemPrecededBy(breedViewStateSuccessFavorite.copy(isLoading = true))
)
}
Expand All @@ -126,7 +126,7 @@ class BreedViewModelTest {
viewModel.breedState.test {
// id is 5 here because it incremented twice when trying to insert duplicate breeds
assertEquals(
BreedViewState(breedViewStateSuccessFavorite.breeds?.plus(Breed(5, "extra", false))),
BreedViewState(breedViewStateSuccessFavorite.breeds.plus(Breed(5, "extra", false))),
awaitItemPrecededBy(BreedViewState(isLoading = true), breedViewStateSuccessFavorite)
)
}
Expand Down

0 comments on commit 7b6ea4c

Please sign in to comment.