@@ -22,8 +22,8 @@ import com.android.contacts.ui.simimport.screen.model.SIM_IMPORT_CONTACTS_TO_IMP
2222import com.android.contacts.ui.simimport.screen.model.SIM_IMPORT_DESELECT_ALL_TEST_TAG
2323import com.android.contacts.ui.simimport.screen.model.SIM_IMPORT_IMPORT_BUTTON_TEST_TAG
2424import com.android.contacts.ui.simimport.screen.model.SIM_IMPORT_SELECT_ALL_TEST_TAG
25- import com.android.contacts.ui.simimport.screen.model.SimImportAction
26- import com.android.contacts.ui.simimport.screen.model.SimImportUiState
25+ import com.android.contacts.ui.simimport.screen.model.SimImportAction as Action
26+ import com.android.contacts.ui.simimport.screen.model.SimImportUiState as State
2727import io.mockk.every
2828import io.mockk.mockk
2929import io.mockk.verify
@@ -38,7 +38,7 @@ import org.robolectric.RobolectricTestRunner
3838@RunWith(RobolectricTestRunner ::class )
3939class SimImportScreenTest {
4040
41- private val fakeUiStateFlow = MutableStateFlow ( SimImportUiState () )
41+ private val fakeUiStateFlow = MutableStateFlow < State >( State . Loading )
4242 private lateinit var screenModel: SimImportScreenModel
4343 private lateinit var effectHandler: SimImportEffectHandler
4444
@@ -52,7 +52,7 @@ class SimImportScreenTest {
5252 @Test
5353 fun showCurrentAccount () = runComposeUiTest {
5454 val account = AccountUiModelFactory .build()
55- fakeUiStateFlow.value = SimImportUiState (
55+ fakeUiStateFlow.value = State . Ready (
5656 accounts = persistentListOf(account),
5757 currentAccount = account,
5858 )
@@ -66,7 +66,7 @@ class SimImportScreenTest {
6666 fun pickAnotherAccount () = runComposeUiTest {
6767 val account1 = AccountUiModelFactory .build(name = " First" )
6868 val account2 = AccountUiModelFactory .build(name = " Second" )
69- fakeUiStateFlow.value = SimImportUiState (
69+ fakeUiStateFlow.value = State . Ready (
7070 accounts = persistentListOf(account1, account2),
7171 currentAccount = account1,
7272 )
@@ -79,14 +79,14 @@ class SimImportScreenTest {
7979 hasText(account2.name!! )
8080 .and (hasTestTag(SIM_IMPORT_ACCOUNT_PICKER_MENU_ITEM_TEST_TAG )),
8181 ).performClick()
82- verify { screenModel.onAction(SimImportAction .AccountChanged (account2)) }
82+ verify { screenModel.onAction(Action .AccountChanged (account2)) }
8383 }
8484
8585 @Test
8686 fun showContactToImport () = runComposeUiTest {
8787 val account = AccountUiModelFactory .build()
8888 val contact = SimContactUiModelFactory .build()
89- fakeUiStateFlow.value = SimImportUiState (
89+ fakeUiStateFlow.value = State . Ready (
9090 accounts = persistentListOf(account),
9191 currentAccount = account,
9292 contactsToImport = persistentListOf(SelectableItem (contact, false )),
@@ -103,7 +103,7 @@ class SimImportScreenTest {
103103 fun clickContact () = runComposeUiTest {
104104 val account = AccountUiModelFactory .build()
105105 val contact = SimContactUiModelFactory .build()
106- fakeUiStateFlow.value = SimImportUiState (
106+ fakeUiStateFlow.value = State . Ready (
107107 accounts = persistentListOf(account),
108108 currentAccount = account,
109109 contactsToImport = persistentListOf(SelectableItem (contact, false )),
@@ -113,13 +113,13 @@ class SimImportScreenTest {
113113 setScreenContent()
114114
115115 onNodeWithText(contact.label).performClick()
116- verify { screenModel.onAction(SimImportAction .ContactSelectionChanged (contact, true )) }
116+ verify { screenModel.onAction(Action .ContactSelectionChanged (contact, true )) }
117117 }
118118
119119 @Test
120120 fun checkTopBarActionsCanBeDisabled () = runComposeUiTest {
121121 val account = AccountUiModelFactory .build()
122- fakeUiStateFlow.value = SimImportUiState (
122+ fakeUiStateFlow.value = State . Ready (
123123 accounts = persistentListOf(account),
124124 currentAccount = account,
125125 contactsToImport = persistentListOf(),
0 commit comments