fix wrong test in "fixing DropdownMenu
keyboard navigation" (#156084)
I accidentally submitted the wrong test in the last commit in https://github.com/flutter/flutter/pull/155252 Re-uploading the correct one.
This commit is contained in:
parent
57d2a20be3
commit
d461426922
@ -1316,26 +1316,25 @@ void main() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Regression test for https://github.com/flutter/flutter/issues/154532.
|
// Regression test for https://github.com/flutter/flutter/issues/154532.
|
||||||
testWidgets('Searching for non matching item does not crash', (WidgetTester tester) async {
|
testWidgets('Keyboard navigation does not throw when no entries match the filter', (WidgetTester tester) async {
|
||||||
await tester.pumpWidget(MaterialApp(
|
await tester.pumpWidget(MaterialApp(
|
||||||
home: Scaffold(
|
home: Scaffold(
|
||||||
body: DropdownMenu<TestMenu>(
|
body: DropdownMenu<TestMenu>(
|
||||||
enableFilter: true,
|
enableFilter: true,
|
||||||
requestFocusOnTap: true,
|
|
||||||
dropdownMenuEntries: menuChildren,
|
dropdownMenuEntries: menuChildren,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
|
|
||||||
// Open the menu.
|
|
||||||
await tester.tap(find.byType(DropdownMenu<TestMenu>));
|
await tester.tap(find.byType(DropdownMenu<TestMenu>));
|
||||||
await tester.pump();
|
await tester.pump();
|
||||||
await tester.enterText(find.byType(TextField).first, 'Me');
|
await tester.enterText(find.byType(TextField).first, 'No match');
|
||||||
await tester.pumpAndSettle();
|
await tester.pump();
|
||||||
await tester.enterText(find.byType(TextField).first, 'Meu');
|
await tester.sendKeyEvent(LogicalKeyboardKey.arrowDown);
|
||||||
await tester.pumpAndSettle();
|
await tester.pump();
|
||||||
|
await tester.enterText(find.byType(TextField).first, 'No match 2');
|
||||||
|
await tester.pump();
|
||||||
expect(tester.takeException(), isNull);
|
expect(tester.takeException(), isNull);
|
||||||
});
|
}, variant: TargetPlatformVariant.desktop());
|
||||||
|
|
||||||
// Regression test for https://github.com/flutter/flutter/issues/147253.
|
// Regression test for https://github.com/flutter/flutter/issues/147253.
|
||||||
testWidgets('Default search prioritises the current highlight on desktop platforms',
|
testWidgets('Default search prioritises the current highlight on desktop platforms',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user