Skip to content

Commit 583582b

Browse files
committed
login test [nfc]: Add await for handlePlatformMessage
The later `await tester.idle` call helps wait for the earlier mock platform message to be handled. We can remove that call and use await on the handlePlatformMessage call itself. Signed-off-by: Zixuan James Li <[email protected]>
1 parent a4565fd commit 583582b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

test/widgets/login_test.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,9 @@ void main() {
219219

220220
final ByteData message = const JSONMethodCodec().encodeMethodCall(
221221
MethodCall('pushRouteInformation', {'location': url.toString()}));
222-
tester.binding.defaultBinaryMessenger.handlePlatformMessage(
222+
await tester.binding.defaultBinaryMessenger.handlePlatformMessage(
223223
'flutter/navigation', message, null);
224224

225-
await tester.idle();
226225
check(testBinding.takeCloseInAppWebViewCallCount()).equals(1);
227226

228227
final account = testBinding.globalStore.accounts.single;

0 commit comments

Comments
 (0)