Skip to content

Commit

Permalink
Fix indentation in flutter integration test example (#9437)
Browse files Browse the repository at this point in the history
## Presubmit checklist

- [x] This PR doesn’t contain automatically generated corrections
(Grammarly or similar).
- [x] This PR follows the [Google Developer Documentation Style
Guidelines](https://developers.google.com/style) — for example, it
doesn’t use _i.e._ or _e.g._, and it avoids _I_ and _we_ (first person).
- [x] This PR uses [semantic line
breaks](https://github.com/dart-lang/site-shared/blob/main/doc/writing-for-dart-and-flutter-websites.md#semantic-line-breaks)
of 80 characters or fewer.

---------

Co-authored-by: Parker Lougheed <parlough@gmail.com>
  • Loading branch information
jakemac53 and parlough authored Sep 21, 2023
1 parent 6e01f33 commit b859bf3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
// #docregion initial
import 'package:flutter_test/flutter_test.dart';
import 'package:how_to/main.dart';
import 'package:integration_test/integration_test.dart';

void main() {
// #enddocregion initial
IntegrationTestWidgetsFlutterBinding.ensureInitialized(); // NEW

// #docregion initial
testWidgets('tap on the floating action button, verify counter',
(tester) async {
// Load app widget.
Expand All @@ -27,3 +30,4 @@ void main() {
expect(find.text('1'), findsOneWidget);
});
}
// #enddocregion initial
4 changes: 2 additions & 2 deletions src/testing/integration-tests/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ Changed 9 dependencies!
In your project, create a new directory
`integration_test` with a new file, `<name>_test.dart`:

<?code-excerpt "integration_test/counter_test.dart" replace="/IntegrationTestWidgetsFlutterBinding\.ensureInitialized\(\); \/\/ NEW\n\n//g"?>
<?code-excerpt "integration_test/counter_test.dart (initial)" plaster="none"?>
```dart
import 'package:flutter_test/flutter_test.dart';
import 'package:how_to/main.dart';
import 'package:integration_test/integration_test.dart';
void main() {
testWidgets('tap on the floating action button, verify counter',
testWidgets('tap on the floating action button, verify counter',
(tester) async {
// Load app widget.
await tester.pumpWidget(const MyApp());
Expand Down

0 comments on commit b859bf3

Please sign in to comment.