Merge "Fix bug in Add network fragment"

This commit is contained in:
TreeHugger Robot
2018-09-15 00:45:17 +00:00
committed by Android (Google) Code Review
2 changed files with 19 additions and 6 deletions

View File

@@ -183,6 +183,22 @@ public class WifiConfigControllerTest {
mController.isSubmittable();
}
@Test
public void isSubmittable_EapToPskWithValidPassword_shouldReturnTrue() {
final TextView password = mView.findViewById(R.id.password);
final Spinner securitySpinner = mView.findViewById(R.id.security);
assertThat(password).isNotNull();
assertThat(securitySpinner).isNotNull();
when(mAccessPoint.isSaved()).thenReturn(true);
// Change it from EAP to PSK
mController.onItemSelected(securitySpinner, null, AccessPoint.SECURITY_EAP, 0);
mController.onItemSelected(securitySpinner, null, AccessPoint.SECURITY_PSK, 0);
password.setText(GOOD_PSK);
assertThat(mController.isSubmittable()).isTrue();
}
@Test
public void getSignalString_notReachable_shouldHaveNoSignalString() {
when(mAccessPoint.isReachable()).thenReturn(false);