Created
February 7, 2020 13:55
-
-
Save OleksandrKucherenko/8476c772ff05f59f70bba8b783f53f76 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
@Config(sdk = Build.VERSION_CODES.LOLLIPOP) | |
public void testFingerprintNoHardware_api21() throws Exception { | |
// GIVEN: API21 android version | |
ReactApplicationContext context = getRNContext(); | |
KeychainModule module = new KeychainModule(context); | |
// WHEN: verify availability | |
final int result = BiometricManager.from(context).canAuthenticate(); | |
final boolean isFingerprintAvailable = module.isFingerprintAuthAvailable(); | |
// THEN: in api lower 23 - biometric is not available at all | |
assertThat(isFingerprintAvailable, is(false)); | |
assertThat(result, is(BiometricManager.BIOMETRIC_ERROR_NO_HARDWARE)); | |
// fingerprint hardware not available, minimal API for fingerprint is api23, Android 6.0 | |
// https://developer.android.com/about/versions/marshmallow/android-6.0 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment