Auto-format Framework (#160545)
This auto-formats all *.dart files in the repository outside of the `engine` subdirectory and enforces that these files stay formatted with a presubmit check. **Reviewers:** Please carefully review all the commits except for the one titled "formatted". The "formatted" commit was auto-generated by running `dev/tools/format.sh -a -f`. The other commits were hand-crafted to prepare the repo for the formatting change. I recommend reviewing the commits one-by-one via the "Commits" tab and avoiding Github's "Files changed" tab as it will likely slow down your browser because of the size of this PR. --------- Co-authored-by: Kate Lovett <katelovett@google.com> Co-authored-by: LongCatIsLooong <31859944+LongCatIsLooong@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
8e0993eda8
commit
5491c8c146
@@ -7,7 +7,9 @@ import 'package:flutter_api_samples/material/autocomplete/autocomplete.2.dart' a
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('can search and find options after waiting for fake network delay', (WidgetTester tester) async {
|
||||
testWidgets('can search and find options after waiting for fake network delay', (
|
||||
WidgetTester tester,
|
||||
) async {
|
||||
await tester.pumpWidget(const example.AutocompleteExampleApp());
|
||||
|
||||
expect(find.text('aardvark'), findsNothing);
|
||||
|
||||
@@ -7,34 +7,37 @@ import 'package:flutter_api_samples/material/autocomplete/autocomplete.3.dart' a
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('can search and find options after waiting for fake network delay and debounce delay', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(const example.AutocompleteExampleApp());
|
||||
testWidgets(
|
||||
'can search and find options after waiting for fake network delay and debounce delay',
|
||||
(WidgetTester tester) async {
|
||||
await tester.pumpWidget(const example.AutocompleteExampleApp());
|
||||
|
||||
expect(find.text('aardvark'), findsNothing);
|
||||
expect(find.text('bobcat'), findsNothing);
|
||||
expect(find.text('chameleon'), findsNothing);
|
||||
expect(find.text('aardvark'), findsNothing);
|
||||
expect(find.text('bobcat'), findsNothing);
|
||||
expect(find.text('chameleon'), findsNothing);
|
||||
|
||||
await tester.enterText(find.byType(TextFormField), 'a');
|
||||
await tester.pump(example.fakeAPIDuration);
|
||||
await tester.enterText(find.byType(TextFormField), 'a');
|
||||
await tester.pump(example.fakeAPIDuration);
|
||||
|
||||
// No results yet, need to also wait for the debounce duration.
|
||||
expect(find.text('aardvark'), findsNothing);
|
||||
expect(find.text('bobcat'), findsNothing);
|
||||
expect(find.text('chameleon'), findsNothing);
|
||||
// No results yet, need to also wait for the debounce duration.
|
||||
expect(find.text('aardvark'), findsNothing);
|
||||
expect(find.text('bobcat'), findsNothing);
|
||||
expect(find.text('chameleon'), findsNothing);
|
||||
|
||||
await tester.pump(example.debounceDuration);
|
||||
await tester.pump(example.debounceDuration);
|
||||
|
||||
expect(find.text('aardvark'), findsOneWidget);
|
||||
expect(find.text('bobcat'), findsOneWidget);
|
||||
expect(find.text('chameleon'), findsOneWidget);
|
||||
expect(find.text('aardvark'), findsOneWidget);
|
||||
expect(find.text('bobcat'), findsOneWidget);
|
||||
expect(find.text('chameleon'), findsOneWidget);
|
||||
|
||||
await tester.enterText(find.byType(TextFormField), 'aa');
|
||||
await tester.pump(example.debounceDuration + example.fakeAPIDuration);
|
||||
await tester.enterText(find.byType(TextFormField), 'aa');
|
||||
await tester.pump(example.debounceDuration + example.fakeAPIDuration);
|
||||
|
||||
expect(find.text('aardvark'), findsOneWidget);
|
||||
expect(find.text('bobcat'), findsNothing);
|
||||
expect(find.text('chameleon'), findsNothing);
|
||||
});
|
||||
expect(find.text('aardvark'), findsOneWidget);
|
||||
expect(find.text('bobcat'), findsNothing);
|
||||
expect(find.text('chameleon'), findsNothing);
|
||||
},
|
||||
);
|
||||
|
||||
testWidgets('debounce is reset each time a character is entered', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(const example.AutocompleteExampleApp());
|
||||
|
||||
@@ -7,34 +7,37 @@ import 'package:flutter_api_samples/material/autocomplete/autocomplete.4.dart' a
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('can search and find options after waiting for fake network delay and debounce delay', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(const example.AutocompleteExampleApp());
|
||||
testWidgets(
|
||||
'can search and find options after waiting for fake network delay and debounce delay',
|
||||
(WidgetTester tester) async {
|
||||
await tester.pumpWidget(const example.AutocompleteExampleApp());
|
||||
|
||||
expect(find.text('aardvark'), findsNothing);
|
||||
expect(find.text('bobcat'), findsNothing);
|
||||
expect(find.text('chameleon'), findsNothing);
|
||||
expect(find.text('aardvark'), findsNothing);
|
||||
expect(find.text('bobcat'), findsNothing);
|
||||
expect(find.text('chameleon'), findsNothing);
|
||||
|
||||
await tester.enterText(find.byType(TextFormField), 'a');
|
||||
await tester.pump(example.fakeAPIDuration);
|
||||
await tester.enterText(find.byType(TextFormField), 'a');
|
||||
await tester.pump(example.fakeAPIDuration);
|
||||
|
||||
// No results yet, need to also wait for the debounce duration.
|
||||
expect(find.text('aardvark'), findsNothing);
|
||||
expect(find.text('bobcat'), findsNothing);
|
||||
expect(find.text('chameleon'), findsNothing);
|
||||
// No results yet, need to also wait for the debounce duration.
|
||||
expect(find.text('aardvark'), findsNothing);
|
||||
expect(find.text('bobcat'), findsNothing);
|
||||
expect(find.text('chameleon'), findsNothing);
|
||||
|
||||
await tester.pump(example.debounceDuration);
|
||||
await tester.pump(example.debounceDuration);
|
||||
|
||||
expect(find.text('aardvark'), findsOneWidget);
|
||||
expect(find.text('bobcat'), findsOneWidget);
|
||||
expect(find.text('chameleon'), findsOneWidget);
|
||||
expect(find.text('aardvark'), findsOneWidget);
|
||||
expect(find.text('bobcat'), findsOneWidget);
|
||||
expect(find.text('chameleon'), findsOneWidget);
|
||||
|
||||
await tester.enterText(find.byType(TextFormField), 'aa');
|
||||
await tester.pump(example.debounceDuration + example.fakeAPIDuration);
|
||||
await tester.enterText(find.byType(TextFormField), 'aa');
|
||||
await tester.pump(example.debounceDuration + example.fakeAPIDuration);
|
||||
|
||||
expect(find.text('aardvark'), findsOneWidget);
|
||||
expect(find.text('bobcat'), findsNothing);
|
||||
expect(find.text('chameleon'), findsNothing);
|
||||
});
|
||||
expect(find.text('aardvark'), findsOneWidget);
|
||||
expect(find.text('bobcat'), findsNothing);
|
||||
expect(find.text('chameleon'), findsNothing);
|
||||
},
|
||||
);
|
||||
|
||||
testWidgets('debounce is reset each time a character is entered', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(const example.AutocompleteExampleApp());
|
||||
|
||||
Reference in New Issue
Block a user