mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-12-23 10:11:52 +03:00
simplify and add hint
This commit is contained in:
parent
40f806ed17
commit
4ae9791841
@ -127,17 +127,15 @@ extension AppWidgetTester on WidgetTester {
|
|||||||
|
|
||||||
await collectYubiKeyInformation();
|
await collectYubiKeyInformation();
|
||||||
|
|
||||||
|
if (yubiKeySerialNumber == null) {
|
||||||
|
fail('No YubiKey connected');
|
||||||
|
}
|
||||||
|
|
||||||
if (!approvedSerialNumbers.contains(yubiKeySerialNumber)) {
|
if (!approvedSerialNumbers.contains(yubiKeySerialNumber)) {
|
||||||
if (yubiKeySerialNumber == null) {
|
fail('YubiKey with S/N $yubiKeySerialNumber is not approved for '
|
||||||
expect(
|
'integration tests.\nUse --dart-define='
|
||||||
approvedSerialNumbers.contains(yubiKeySerialNumber), equals(true),
|
'YA_TEST_APPROVED_KEY_SN=$yubiKeySerialNumber test '
|
||||||
reason: 'No YubiKey connected');
|
'parameter to approve it.');
|
||||||
} else {
|
|
||||||
expect(
|
|
||||||
approvedSerialNumbers.contains(yubiKeySerialNumber), equals(true),
|
|
||||||
reason:
|
|
||||||
'YubiKey with S/N $yubiKeySerialNumber is not approved for integration tests.');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -186,9 +184,10 @@ extension AppWidgetTester on WidgetTester {
|
|||||||
// close the opened menu
|
// close the opened menu
|
||||||
await closeDrawer();
|
await closeDrawer();
|
||||||
|
|
||||||
testLog(false,
|
if (yubiKeySerialNumber != null) {
|
||||||
'Connected YubiKey: $yubiKeySerialNumber/$yubiKeyFirmware - $yubiKeyName');
|
testLog(false,
|
||||||
|
'Connected YubiKey: $yubiKeySerialNumber/$yubiKeyFirmware - $yubiKeyName');
|
||||||
|
}
|
||||||
collectedYubiKeyInformation = true;
|
collectedYubiKeyInformation = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user