Skip to content

Automatically reset the test size between tests.#1399

Merged
DaveShuckerow merged 5 commits intoflutter:masterfrom
DaveShuckerow:test-size
Nov 25, 2019
Merged

Automatically reset the test size between tests.#1399
DaveShuckerow merged 5 commits intoflutter:masterfrom
DaveShuckerow:test-size

Conversation

@DaveShuckerow
Copy link
Copy Markdown
Contributor

A lot of tests weren't calling resetWindowSize at the end of the test, which I believe was leading to the overridden window size propagating across tests.

@DaveShuckerow DaveShuckerow marked this pull request as ready for review November 25, 2019 19:38
Future<void> setWindowSize(Size windowSize) async {
/// Runs a test with the size of the app window under test to [windowSize].
@isTest
void testWidgetsWithSize(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: rename to testWidgetsWithWindowSize as withSize makes it seem like size is referring to the widget, not the window

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@isTest
void testWidgetsWithSize(
String name, Size windowSize, WidgetTesterCallback test,
{bool skip = false}) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trailing comma

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@DaveShuckerow DaveShuckerow merged commit bed3090 into flutter:master Nov 25, 2019
@DaveShuckerow DaveShuckerow deleted the test-size branch November 25, 2019 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants