simplify and add hint

This commit is contained in:
Adam Velebil 2023-11-14 14:03:47 +01:00
parent 40f806ed17
commit 4ae9791841
No known key found for this signature in database
GPG Key ID: C9B1E4A3CBBD2E10

View File

@ -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;
} }
} }