Skip to content

Commit

Permalink
test: remove api 16 phone number format test
Browse files Browse the repository at this point in the history
This is probably no longer needed, since the Firebase Auth SDK now requires minSDK 23
  • Loading branch information
thatfiredev committed Sep 2, 2024
1 parent fb0d29d commit 0f161d6
Showing 1 changed file with 0 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,38 +83,6 @@ public void testGetCountryCode() {
assertEquals(null, getCountryCode(new Locale("", "DJJZ").getCountry()));
}

@Test
@Config(sdk = 16)
public void testFormatNumberToE164_belowApi21() {
String validPhoneNumber = "+919994947354";
CountryInfo indiaCountryInfo = new CountryInfo(new Locale("", "IN"), 91);
// no leading plus
assertEquals(validPhoneNumber, format("9994947354", indiaCountryInfo));
// fully formatted
assertEquals(validPhoneNumber, format("+919994947354", indiaCountryInfo));
// parantheses and hyphens
assertEquals(validPhoneNumber, format("(99949) 47-354", indiaCountryInfo));

// The following cases would fail for lower api versions.
// Leaving tests in place to formally identify cases

// no leading +
// assertEquals(validPhoneNumber, format("919994947354", indiaCountryInfo));

// with hyphens
// assertEquals(validPhoneNumber, format("+91-(999)-(49)-(47354)",
// indiaCountryInfo));

// with spaces leading plus
// assertEquals(validPhoneNumber, format("+91 99949 47354", indiaCountryInfo));

// space formatting
// assertEquals(validPhoneNumber, format("91 99949 47354", indiaCountryInfo));

// invalid phone number
// assertNull(format("999474735", indiaCountryInfo));
}

@Test
public void testGetCurrentCountryInfo_fromSim() {
Context context = mock(Context.class);
Expand Down

0 comments on commit 0f161d6

Please sign in to comment.