From 32b43949f0b5502abf90cf35bd8fcc76e08bdcda Mon Sep 17 00:00:00 2001 From: Frank Merkel <138444693+frankmer@users.noreply.github.com> Date: Tue, 15 Oct 2024 17:20:00 +0200 Subject: [PATCH] fixed tests --- test/unit_test/state_notifiers/token_notifier_test.dart | 2 ++ test/unit_test/utils/crypto_utils_test.dart | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/test/unit_test/state_notifiers/token_notifier_test.dart b/test/unit_test/state_notifiers/token_notifier_test.dart index ec773b80b..1b93ea6f2 100644 --- a/test/unit_test/state_notifiers/token_notifier_test.dart +++ b/test/unit_test/state_notifiers/token_notifier_test.dart @@ -265,6 +265,7 @@ void _testTokenNotifier() { const qrCode = 'otpauth://totp/issuer2:label2?secret=AAAAAAAA2&issuer=issuer2&algorithm=SHA256&digits=6&period=30'; final tokenNotifier = container.read(tokenProvider.notifier); await scanQrCode(resultHandlerList: [tokenNotifier], qrCode: qrCode); + await Future.delayed(const Duration(seconds: 5)); // Wait for the rollout to finish final state = container.read(tokenProvider); expect(state, isNotNull); after.last = after.last.copyWith(id: state.tokens.last.id); @@ -352,6 +353,7 @@ void _testTokenNotifier() { final initState = await notifier.initState; expect(initState.tokens, before); await scanQrCode(resultHandlerList: [notifier], qrCode: otpAuth); + await Future.delayed(const Duration(seconds: 5)); // Wait for the rollout to finish final tokenState = container.read(testProvider); expect(tokenState, isNotNull); expect(tokenState.tokens, after); diff --git a/test/unit_test/utils/crypto_utils_test.dart b/test/unit_test/utils/crypto_utils_test.dart index 925f8722c..1a7e6ecf2 100644 --- a/test/unit_test/utils/crypto_utils_test.dart +++ b/test/unit_test/utils/crypto_utils_test.dart @@ -409,7 +409,7 @@ void _testDecodeSecretToUint8() { }); test('Test non base32 secret', () { - expect(() => Encodings.base32.decode('p'), throwsFormatException); + expect(() => Encodings.base32.decode('AAA+AAA='), throwsFormatException); expect(() => Encodings.base32.decode('AAAAAAƶA'), throwsFormatException); });