Created
February 7, 2020 13:56
-
-
Save OleksandrKucherenko/029f45aad15f02e1d1c7ab25ebe1d077 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.M) | |
public void testFingerprintAvailableButNotConfigured_api23() throws Exception { | |
// GIVEN: | |
// fingerprint api available but not configured properly | |
// API23 android version | |
ReactApplicationContext context = getRNContext(); | |
KeychainModule module = new KeychainModule(context); | |
// set that hardware is available | |
FingerprintManager fm = (FingerprintManager) context.getSystemService(Context.FINGERPRINT_SERVICE); | |
shadowOf(fm).setIsHardwareDetected(true); | |
// WHEN: check availability | |
final int result = BiometricManager.from(context).canAuthenticate(); | |
final boolean isFingerprintWorking = module.isFingerprintAuthAvailable(); | |
// THEN: another status from biometric api, fingerprint is still unavailable | |
assertThat(result, is(BiometricManager.BIOMETRIC_ERROR_NONE_ENROLLED)); | |
assertThat(isFingerprintWorking, is(false)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment