Clear the keyboard state in the test framework when keyboard is closed. (#18615)

This commit is contained in:
Ian Hickson
2018-06-26 15:11:37 -07:00
committed by GitHub
parent 8d0c3bf734
commit b44784b429
6 changed files with 71 additions and 20 deletions

View File

@@ -506,6 +506,27 @@ void main() {
});
});
});
testWidgets('showKeyboard can be called twice', (WidgetTester tester) async {
await tester.pumpWidget(
new MaterialApp(
home: new Material(
child: new Center(
child: new TextFormField(),
),
),
),
);
await tester.showKeyboard(find.byType(TextField));
tester.testTextInput.receiveAction(TextInputAction.done);
await tester.pump();
await tester.showKeyboard(find.byType(TextField));
tester.testTextInput.receiveAction(TextInputAction.done);
await tester.pump();
await tester.showKeyboard(find.byType(TextField));
await tester.showKeyboard(find.byType(TextField));
await tester.pump();
});
}
class FakeMatcher extends AsyncMatcher {