use of com.kickstarter.services.ApiClientType in project android-oss by kickstarter.
the class ActivityFeedViewModelTest method testLoginFlow.
@Test
public void testLoginFlow() {
final ApiClientType apiClient = new MockApiClient();
final CurrentUserType currentUser = new MockCurrentUser();
final Environment environment = this.environment().toBuilder().apiClient(apiClient).currentUser(currentUser).build();
setUpEnvironment(environment);
// Empty activity feed with login button should be shown.
this.loggedOutEmptyStateIsVisible.assertValue(true);
// Login.
this.vm.inputs.emptyActivityFeedLoginClicked(null);
this.goToLogin.assertValueCount(1);
currentUser.refresh(UserFactory.user());
// Empty states are not shown when activities emit on successful login.
this.activityList.assertValueCount(1);
this.loggedOutEmptyStateIsVisible.assertValues(true, false);
this.loggedInEmptyStateIsVisible.assertValue(false);
}
Aggregations