Update plugin test template. (#13516)
* Update plugin test template. * Add flutter test run verification. * Tweak and test runs for package projects.
This commit is contained in:
@@ -9,6 +9,7 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
import 'package:{{projectName}}/main.dart';
|
||||
|
||||
{{^withPluginHook}}
|
||||
void main() {
|
||||
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
|
||||
// Build our app and trigger a frame.
|
||||
@@ -27,3 +28,20 @@ void main() {
|
||||
expect(find.text('1'), findsOneWidget);
|
||||
});
|
||||
}
|
||||
{{/withPluginHook}}
|
||||
{{#withPluginHook}}
|
||||
void main() {
|
||||
testWidgets('Verify Platform version', (WidgetTester tester) async {
|
||||
// Build our app and trigger a frame.
|
||||
await tester.pumpWidget(new MyApp());
|
||||
|
||||
// Verify that platform version is retrieved.
|
||||
expect(
|
||||
find.byWidgetPredicate(
|
||||
(Widget widget) =>
|
||||
widget is Text && widget.data.startsWith('Running on:'),
|
||||
),
|
||||
findsOneWidget);
|
||||
});
|
||||
}
|
||||
{{/withPluginHook}}
|
||||
|
||||
Reference in New Issue
Block a user