Search in sources :

Example 1 with EmailActivity

use of com.firebase.ui.auth.ui.email.EmailActivity in project FirebaseUI-Android by firebase.

the class AuthMethodPickerActivityTest method testCustomAuthMethodPickerLayout.

@Test
public void testCustomAuthMethodPickerLayout() {
    List<String> providers = Arrays.asList(EmailAuthProvider.PROVIDER_ID);
    AuthMethodPickerLayout customLayout = new AuthMethodPickerLayout.Builder(R.layout.fui_provider_button_email).setEmailButtonId(R.id.email_button).build();
    AuthMethodPickerActivity authMethodPickerActivity = createActivityWithCustomLayout(providers, customLayout, false);
    Button emailButton = authMethodPickerActivity.findViewById(R.id.email_button);
    emailButton.performClick();
    // Expected result -> Directing users to EmailActivity
    ShadowActivity.IntentForResult nextIntent = Shadows.shadowOf(authMethodPickerActivity).getNextStartedActivityForResult();
    assertEquals(EmailActivity.class.getName(), nextIntent.intent.getComponent().getClassName());
}
Also used : AuthMethodPickerLayout(com.firebase.ui.auth.AuthMethodPickerLayout) Button(android.widget.Button) ShadowActivity(org.robolectric.shadows.ShadowActivity) EmailActivity(com.firebase.ui.auth.ui.email.EmailActivity) Test(org.junit.Test)

Example 2 with EmailActivity

use of com.firebase.ui.auth.ui.email.EmailActivity in project FirebaseUI-Android by firebase.

the class AuthMethodPickerActivityTest method testCustomAuthMethodPickerLayoutWithDefaultEmail.

@Test
public void testCustomAuthMethodPickerLayoutWithDefaultEmail() {
    List<String> providers = Arrays.asList(EmailAuthProvider.PROVIDER_ID);
    AuthMethodPickerLayout customLayout = new AuthMethodPickerLayout.Builder(R.layout.fui_provider_button_email).setEmailButtonId(R.id.email_button).build();
    AuthMethodPickerActivity authMethodPickerActivity = createActivityWithCustomLayout(providers, customLayout, true);
    Button emailButton = authMethodPickerActivity.findViewById(R.id.email_button);
    emailButton.performClick();
    // Expected result -> Directing users to EmailActivity
    ShadowActivity.IntentForResult nextIntent = Shadows.shadowOf(authMethodPickerActivity).getNextStartedActivityForResult();
    assertEquals(EmailActivity.class.getName(), nextIntent.intent.getComponent().getClassName());
}
Also used : AuthMethodPickerLayout(com.firebase.ui.auth.AuthMethodPickerLayout) Button(android.widget.Button) ShadowActivity(org.robolectric.shadows.ShadowActivity) EmailActivity(com.firebase.ui.auth.ui.email.EmailActivity) Test(org.junit.Test)

Example 3 with EmailActivity

use of com.firebase.ui.auth.ui.email.EmailActivity in project FirebaseUI-Android by firebase.

the class AuthMethodPickerActivityTest method testCustomAuthMethodPickerLayoutWithEmailLink.

@Test
public void testCustomAuthMethodPickerLayoutWithEmailLink() {
    List<String> providers = Arrays.asList(EmailAuthProvider.EMAIL_LINK_SIGN_IN_METHOD);
    AuthMethodPickerLayout customLayout = new AuthMethodPickerLayout.Builder(R.layout.fui_provider_button_email).setEmailButtonId(R.id.email_button).build();
    AuthMethodPickerActivity authMethodPickerActivity = createActivityWithCustomLayout(providers, customLayout, false);
    Button emailButton = authMethodPickerActivity.findViewById(R.id.email_button);
    emailButton.performClick();
    // Expected result -> Directing users to EmailActivity
    ShadowActivity.IntentForResult nextIntent = Shadows.shadowOf(authMethodPickerActivity).getNextStartedActivityForResult();
    assertEquals(EmailActivity.class.getName(), nextIntent.intent.getComponent().getClassName());
}
Also used : AuthMethodPickerLayout(com.firebase.ui.auth.AuthMethodPickerLayout) Button(android.widget.Button) ShadowActivity(org.robolectric.shadows.ShadowActivity) EmailActivity(com.firebase.ui.auth.ui.email.EmailActivity) Test(org.junit.Test)

Aggregations

Button (android.widget.Button)3 AuthMethodPickerLayout (com.firebase.ui.auth.AuthMethodPickerLayout)3 EmailActivity (com.firebase.ui.auth.ui.email.EmailActivity)3 Test (org.junit.Test)3 ShadowActivity (org.robolectric.shadows.ShadowActivity)3