Umbrella issue: #177028
Design doc: https://docs.google.com/document/d/1UHxALQqCbmgjnM1RNV9xE2pK3IGyx-UktGX1D7hYCjs/edit?tab=t.0
Tests should be located in the library whose code they are testing. If a tests needs to test multiple libraries (say, a platform adaptive constructor), then put it in Material. This will help with our general test organization and also help remove a devDependency after Material and Cupertino are decoupled from the framework.
How to fix
Find a test listed below that is not already fixed (checked) and that does not have a PR already linked.
Look at the test that references Material/Cupertino and double check whether it would be possible to migrate the test to remove the dependency. I may have made a mistake including it in this issue (maybe it should be in (Test cross-imports) Don't import Material in tests for convenience #177415 instead).
If I was wrong and the test doesn't need Material/Cupertino, refactor it to remove the dependency instead of moving the test! Otherwise, for any test that is fundamentally is about testing Material/Cupertino, copy it out of its current file and into test/material or test/cupertino.
Ensure that all such tests have been removed from the file, and then delete the Material/Cupertino import.
If there are no tests left in the file, delete the file altogether.
In your PR, reference this issue as "Part of" instead of "Fixes", to avoid it being prematurely closed.
Tests to fix
Located in Widgets, imported Material
Remove Material Dependency from semantics_debugger_test #181722
test/widgets/routes_test.dart
Located in Widgets, imported Material.
Category: Misplacement and Convenience
test/widgets/sliver_main_axis_group_test.dart
Located in Widgets, imported Material.
Category: Misplacement and Convenience
Button
test/widgets/sliver_appbar_opacity_test.dart
Located in Widgets, imported Material.
Category: Misplacement
test/widgets/semantics_tester_generate_test_semantics_expression_for_current_semantics_tree_test.dart
Located in Widgets, imported Material.
Category: Misplacement
Could be a bigger refactor could fix it.
refactor: Remove material imports from editable_text_scribble_test, editable_text_scribe_test, page_route_builder_test, radio_group_test, semantics_debugger_test, range_maintaining_scroll_physics_test, two_dimensional_scroll_view_test, routes_test, text_selection_test, selectable_region_test and text_golden_test #184798
test/widgets/tap_region_test.dart
Located in Widgets, imported Material.
Category: Misplacement
Move heroes_test.dart from widgets to material directory #181266
test/widgets/decorated_sliver_test.dart
Located in Widgets, imported Material.
Category: Misplacement
test/widgets/navigator_test.dart
Located in Widgets, imported Material.
Category: Misplacement
test/widgets/sliver_semantics_test.dart
Awaiting PR from @navaronbracke
Located in Widgets, imported Material.
Category: Misplacement
Note that there is also sliversemantics_test.dart, also misplaced.
navigator_on_did_remove_page_test
test/widgets/editable_text_test.dart
Located in Widgets, imported Material.
Category: Misplacement
Among others problems. Big test
Remove material imports from navigator_on_did_remove_page_test and scrollable_in_overlay_test #182546
test/widgets/autofill_group_test.dart
Located in Widgets, imported Material.
Category: Misplacement
test/widgets/scrollbar_test.dart
Located in Widgets, imported Material.
Category: Misplacement
Only one test out of many in the file uses Material I think.
test/widgets/scrollable_test.dart
Located in Widgets, imported Material.
Category: Misplacement
test/widgets/text_selection_toolbar_utils.dart
Located in Widgets, imported Material.
Category: Misplacement
test/widgets/two_dimensional_viewport_test.dart
Located in Widgets, imported Material.
Category: Misplacement
test/widgets/semantics_role_checks_test.dart
Located in Widgets, imported Material.
Category: Misplacement
test/widgets/routes_transition_test.dart
Located in Widgets, imported Material.
Category: Misplacement
test/widgets/scrollable_semantics_test.dart
Located in Widgets, imported Material.
Category: Misplacement
Remove material from slivers_appbar_floating_pinned_test.dart + slivers_appbar_stretch_test.dart + sliver_persistent_header_test.dart + slivers_appbar_floating_test.dart #181469
test/widgets/scrollable_selection_test.dart
Located in Widgets, imported Material.
Category: Misplacement
test/widgets/scrollable_restoration_test.dart
Located in Widgets, imported Material.
Category: Misplacement
test/widgets/sliver_fill_remaining_test.dart
Located in Widgets, imported Material.
Category: Misplacement
test/widgets/nested_scroll_view_test.dart
Located in Widgets, imported Material.
Category: Misplacement
test/widgets/selectable_text_test.dart
Located in Widgets, imported Material.
Category: Misplacement
Remove material from slivers_appbar_floating_pinned_test.dart + slivers_appbar_stretch_test.dart + sliver_persistent_header_test.dart + slivers_appbar_floating_test.dart #181469
refactor: Remove material imports from editable_text_scribble_test, editable_text_scribe_test, page_route_builder_test, radio_group_test, semantics_debugger_test, range_maintaining_scroll_physics_test, two_dimensional_scroll_view_test, routes_test, text_selection_test, selectable_region_test and text_golden_test #184798
refactor: Remove material imports from editable_text_scribble_test, editable_text_scribe_test, page_route_builder_test, radio_group_test, semantics_debugger_test, range_maintaining_scroll_physics_test, two_dimensional_scroll_view_test, routes_test, text_selection_test, selectable_region_test and text_golden_test #184798
test/widgets/inherited_test.dart
Located in Widgets, imported Material.
Category: Misplacement
test/widgets/html_element_view_test.dart
Located in Widgets, imported Material.
Category: Misplacement
test/widgets/drawer_test.dart
Located in Widgets, imported Material.
Category: Misplacement
test/widgets/page_transitions_builder_test.dart
Located in Widgets, imported Material.
Category: Misplacement
test/widgets/implicit_animations_test.dart
Located in Widgets, imported Material.
Category: Misplacement
Move scroll_view_test.dart from widgets to material directory #181268
test/widgets/navigator_replacement_test.dart
Located in Widgets, imported Material.
Category: Misplacement
test/widgets/sliversemantics_test.dart
Awaiting PR from @navaronbracke
Located in Widgets, imported Material.
Category: Misplacement
Note that there is also sliver_semantics_test.dart, also misplaced.
test/widgets/form_test.dart
Located in Widgets, imported Material.
Category: Misplacement
Remove material from slivers_appbar_floating_pinned_test.dart + slivers_appbar_stretch_test.dart + sliver_persistent_header_test.dart + slivers_appbar_floating_test.dart #181469
Migration: Remove material.dart dependency from framework_test.dart (Issue #177414) #181620
test/widgets/autocomplete_test.dart
Located in Widgets, imported Material.
Category: Misplacement
Located in Cupertino, imported Material
Located in Widgets, imported Cupertino
Umbrella issue: #177028
Design doc: https://docs.google.com/document/d/1UHxALQqCbmgjnM1RNV9xE2pK3IGyx-UktGX1D7hYCjs/edit?tab=t.0
Tests should be located in the library whose code they are testing. If a tests needs to test multiple libraries (say, a platform adaptive constructor), then put it in Material. This will help with our general test organization and also help remove a devDependency after Material and Cupertino are decoupled from the framework.
How to fix
Tests to fix
Located in Widgets, imported Material
semantics_debugger_test#181722Located in Cupertino, imported Material
Located in Widgets, imported Cupertino