Skip to content

Commit 338555b

Browse files
authored
Refactor DropdownMenu tests (#157913)
## Description This PR introduces some utility functions to simplify some DropdownMenu tests. The main purpose is to centralize and document how tests should find menu items, because it is tricky as there are two occurrences of each widgets and using '.last' is mandatory: ```dart Finder findMenuItemButton(String label) { // For each menu items there are two MenuItemButton widgets. // The last one is the real button item in the menu. // The first one is not visible, it is part of _DropdownMenuBody // which is used to compute the dropdown width. return find.widgetWithText(MenuItemButton, label).last; } ``` ## Related Issue This is extracted from flutter/flutter#157496. ## Tests Refactors many existing tests.
1 parent 47723f6 commit 338555b

File tree

2 files changed

+106
-128
lines changed

2 files changed

+106
-128
lines changed

0 commit comments

Comments
 (0)