widget_test.dart 1.0 KB

12345678910111213141516171819202122232425262728
  1. // This is a basic Flutter widget test.
  2. //
  3. // To perform an interaction with a widget in your test, use the WidgetTester
  4. // utility in the flutter_test package. For example, you can send tap and scroll
  5. // gestures. You can also use WidgetTester to find child widgets in the widget
  6. // tree, read text, and verify that the values of widget properties are correct.
  7. import 'package:flutter_test/flutter_test.dart';
  8. void main() {
  9. testWidgets('Counter increments smoke test', (WidgetTester tester) async {
  10. // Build our app and trigger a frame.
  11. // await tester.pumpWidget(const MyApp());
  12. //
  13. // // Verify that our counter starts at 0.
  14. // expect(find.text('0'), findsOneWidget);
  15. // expect(find.text('1'), findsNothing);
  16. //
  17. // // Tap the '+' icon and trigger a frame.
  18. // await tester.tap(find.byIcon(Icons.add));
  19. // await tester.pump();
  20. //
  21. // // Verify that our counter has incremented.
  22. // expect(find.text('0'), findsNothing);
  23. // expect(find.text('1'), findsOneWidget);
  24. });
  25. }