Move scroll_view_test.dart from widgets to material directory#181268
Move scroll_view_test.dart from widgets to material directory#181268kazbeksultanov wants to merge 4 commits intoflutter:masterfrom
Conversation
…tory ScrollView tests test Material-specific scroll behavior (MaterialApp, Scaffold, Material-specific scroll views). These Material-specific tests belong in the material test directory, not widgets. This change: - Moves packages/flutter/test/widgets/scroll_view_test.dart to packages/flutter/test/material/ - Copies states.dart helper to material directory (required by scroll_view_test.dart) - Removes scroll_view_test.dart from the knownWidgetsCrossImports list in check_tests_cross_imports.dart This is part of issue flutter#177414 to organize tests in the library they're testing.
There was a problem hiding this comment.
Code Review
This pull request successfully moves scroll_view_test.dart from the widgets directory to the material directory, along with its dependency states.dart. The check_tests_cross_imports.dart file has been updated to reflect this change, removing the old path from the knownWidgetsCrossImports list. The changes align with the stated goal of organizing tests by the library they are testing.
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
|
|
||
| const List<String> kStates = <String>[ |
There was a problem hiding this comment.
The kStates constant is a public member and should have documentation explaining its purpose, as per the Flutter style guide. Please add a /// doc comment above its declaration.
For example:
/// A list of US states used for testing purposes.
const List<String> kStates = <String>[
'Alabama',
// ...
];There was a problem hiding this comment.
Hopefully we don't end up needing this in Material at all.
There was a problem hiding this comment.
We don't, see #181281 where I figured out that one test was in the wrong place.
I'm just waiting on the TestTextField & TestWidgetsApp to land.
I would prefer to close this PR then.
There was a problem hiding this comment.
This is another one that shouldn't be moved. We should try to test this CustomScrollView stuff in the Widgets library where possible. There are a lot of Material things that are here for convenience only. You'll probably find a use for TestWidgetsApp and TestTextField.
There was a problem hiding this comment.
Yes, I will need TestWidgetsApp and TestTextField.
Seems like I need to wait then it will be merged to master
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
|
|
||
| const List<String> kStates = <String>[ |
There was a problem hiding this comment.
Hopefully we don't end up needing this in Material at all.
…al directory" This reverts commit d66e548.
…terial components, and removed test related to scaffold drawer
|
I fixed all tests using only
This test depends on I temporarily removed it, but we should align on the right long-term direction: Option A — Keep it in WidgetsRefactor the test to avoid Option B — Move it to MaterialRestore the test under Material, since I’m slightly leaning toward Option B, since this behavior is tied to Material UI semantics — but happy to follow the preferred direction. What do you think @justinmc @navaronbracke? |
|
@kazbeksultanov I already fixed that test in #181281 That test is in the wrong file, since it should be in the scaffold test. You can probably close this PR then, since you also duplicated the test text field etc. |
|
Let's close this and go with #181281. I agree we should go with option B and wait for TestTextFieldto land. Sorry for the overlap @kazbeksultanov and @navaronbracke, I'm struggling to keep track of all of the work on these tests. I've updated the issues to include links to in-progress PRs in the big checklist of tests. |
|
Got it. No problem 👍 |
|
TestWidgetsApp's pull request is still in review it seems. |
This PR removes the material import from scroll_view_test.dart Part of #177415 Closes #181268 *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].* ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
This PR removes the material import from scroll_view_test.dart Part of flutter#177415 Closes flutter#181268 *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].* ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
ScrollView tests test Material-specific scroll behavior (MaterialApp, Scaffold, Material-specific scroll views). These Material-specific tests belong in the material test directory, not widgets.
This change:
This is part of issue #177414 to organize tests in the library they're testing.
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.