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
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/routes_test.dart
Located in Widgets, imported Material.
Category: Misplacement and Convenience
refactor: remove material import froma sliver_main_axis_group_test, sliver_semantics_test, semantics_role_checks_test, sliver_fill_remaining_test, tap_region_test #185567
test/widgets/sliver_appbar_opacity_test.dart
Located in Widgets, imported Material.
Category: Misplacement
Refactor: remove material from autocomplete_test, scrollable_restoration_test, semantics_tester_generate_test_semantics_expression_for_current_semantics_tree_test #184615
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 import froma sliver_main_axis_group_test, sliver_semantics_test, semantics_role_checks_test, sliver_fill_remaining_test, tap_region_test #185567
Move heroes_test.dart from widgets to material directory #181266
http://github.com/flutter/flutter/pull/181613
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.
refactor: Remove material imports from Widget tests #184877 , Remove Material import from navigator_on_did_remove_page_test #184776
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
Refactor autofill_group_test.dart to remove Material dependencies #181903
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.
Remove material from scrollable_test.dart #181429
test/widgets/text_selection_toolbar_utils.dart
Located in Widgets, imported Material.
Category: Misplacement
refactor: remove material in pop_scope_test, route_notification_message_test, two_dimensional_utils, two_dimensional_viewport_test #182699
refactor: remove material import froma sliver_main_axis_group_test, sliver_semantics_test, semantics_role_checks_test, sliver_fill_remaining_test, tap_region_test #185567
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
Refactor: remove material from autocomplete_test, scrollable_restoration_test, semantics_tester_generate_test_semantics_expression_for_current_semantics_tree_test #184615
refactor: remove material import froma sliver_main_axis_group_test, sliver_semantics_test, semantics_role_checks_test, sliver_fill_remaining_test, tap_region_test #185567
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
Move SelectionArea web test from widgets to material folder #181951
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
Remove Material import from implicit animation tests #186673
Remove Material import from scroll_view_test.dart #181281 , Move scroll_view_test.dart from widgets to material directory #181268
Remove Material import from navigator replacement tests #186674
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
refactor: Remove material imports from Widget tests #185078 , Migration: Remove material.dart dependency from framework_test.dart (Issue #177414) #181620
Refactor: remove material from autocomplete_test, scrollable_restoration_test, semantics_tester_generate_test_semantics_expression_for_current_semantics_tree_test #184615
Located in Cupertino, imported Material
Located in Widgets, imported Cupertino
test/widgets/routes_test.dart
Located in Widgets, imported Cupertino.
Category: Misplacement
test/widgets/text_selection_toolbar_utils.dart
Located in Widgets, imported Cupertino.
Category: Misplacement
Probably move to Cupertino and import from Material when needed for cross platform.
test/widgets/editable_text_test.dart
Located in Widgets, imported Cupertino.
Category: Misplacement
Quite a lot here.
test/widgets/selectable_text_test.dart
Located in Widgets, imported Cupertino.
Category: Misplacement
refactor: remove material from widget_inspector_test, sliver_cross_axis_group_test, editable_text_show_on_screen_test, scrollable_fling_test, selection_container_test #182702
test/widgets/heroes_test.dart
Located in Widgets, imported Cupertino.
Category: Misplacement
test/widgets/live_text_utils.dart
Located in Widgets, imported Cupertino.
Category: Misplacement
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
Located in Cupertino, imported Material
Located in Widgets, imported Cupertino