Fix opening OATH dialog in tests.

This commit is contained in:
Dain Nilsson 2023-02-27 11:14:25 +01:00
parent 47e577c947
commit 5e85c89c8f
No known key found for this signature in database
GPG Key ID: F04367096FBA95E8

View File

@ -112,6 +112,7 @@ extension OathFunctions on WidgetTester {
} }
await shortWait(); await shortWait();
/// find an AccountView with issuer/name in the account list /// find an AccountView with issuer/name in the account list
var matchingAccounts = find.descendant( var matchingAccounts = find.descendant(
of: findAccountList(), of: findAccountList(),
@ -146,8 +147,11 @@ extension OathFunctions on WidgetTester {
expect(accountView, isNotNull); expect(accountView, isNotNull);
if (accountView != null) { if (accountView != null) {
await ensureVisible(find.byWidget(accountView)); final accountFinder = find.byWidget(accountView);
await tap(find.byWidget(accountView)); await ensureVisible(accountFinder);
final codeButtonFinder = find.descendant(
of: accountFinder, matching: find.bySubtype<FilledButton>());
await tap(codeButtonFinder);
await shortWait(); await shortWait();
} }
} }