Fix test + lint

This commit is contained in:
Valere 2020-11-25 17:17:48 +01:00
parent a8b5a5227f
commit bcd86977d2
3 changed files with 4 additions and 3 deletions

View file

@ -310,7 +310,10 @@ class UiAllScreensSanityTest {
clickOn(R.id.createChatRoomButton)
withIdlingResource(activityIdlingResource(CreateDirectRoomActivity::class.java)) {
assertDisplayed(R.id.addByMatrixId)
onView(withId(R.id.userListRecyclerView))
.perform(waitForView(withText(R.string.qr_code)))
onView(withId(R.id.userListRecyclerView))
.perform(waitForView(withText(R.string.invite_friends)))
}
closeSoftKeyboard()

View file

@ -47,7 +47,6 @@ class UserCodeSharedViewModel @AssistedInject constructor(
companion object : MvRxViewModelFactory<UserCodeSharedViewModel, UserCodeState> {
override fun create(viewModelContext: ViewModelContext, state: UserCodeState): UserCodeSharedViewModel? {
val args = viewModelContext.args<UserCodeActivity.Args>()
val factory = when (viewModelContext) {
is FragmentViewModelContext -> viewModelContext.fragment as? Factory
is ActivityViewModelContext -> viewModelContext.activity as? Factory

View file

@ -63,7 +63,6 @@ class UserListViewModel @AssistedInject constructor(@Assisted initialState: User
is FragmentViewModelContext -> viewModelContext.fragment as? Factory
is ActivityViewModelContext -> viewModelContext.activity as? Factory
}
val args = viewModelContext.args<UserListFragmentArgs>()
return factory?.create(state) ?: error("You should let your activity/fragment implements Factory interface")
}
}