From 7b6ea4cd586d4a69fedfb494cbf63b1c284785c3 Mon Sep 17 00:00:00 2001 From: bpedryc Date: Thu, 15 Jun 2023 08:44:13 +0200 Subject: [PATCH] Fix the BreedViewModelTest to be compatible with non-nullable state members --- .../kotlin/co/touchlab/kampkit/BreedViewModelTest.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shared/src/commonTest/kotlin/co/touchlab/kampkit/BreedViewModelTest.kt b/shared/src/commonTest/kotlin/co/touchlab/kampkit/BreedViewModelTest.kt index 7914dc28..38654cad 100644 --- a/shared/src/commonTest/kotlin/co/touchlab/kampkit/BreedViewModelTest.kt +++ b/shared/src/commonTest/kotlin/co/touchlab/kampkit/BreedViewModelTest.kt @@ -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 @@ -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)) ) } @@ -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) ) }