| 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 that Flutter provides. 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 | |
| 8 | import 'dart:async'; |
| 9 | |
| 10 | import 'package:flutter/material.dart'; |
| 11 | import 'package:flutter_test/flutter_test.dart'; |
| 12 | |
| 13 | import 'package:cake_wallet/main.dart'; |
| 14 | |
| 15 | final quickActionsStream = StreamController<Uri?>.broadcast(); |
| 16 | |
| 17 | void main() { |
| 18 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { |
| 19 | // Build our app and trigger a frame. |
| 20 | await tester.pumpWidget(App(quickActionsStream: quickActionsStream.stream)); |
| 21 | |
| 22 | // Verify that our counter starts at 0. |
| 23 | expect(find.text('0'), findsOneWidget); |
| 24 | expect(find.text('1'), findsNothing); |
| 25 | |
| 26 | // Tap the '+' icon and trigger a frame. |
| 27 | await tester.tap(find.byIcon(Icons.add)); |
| 28 | await tester.pump(); |
| 29 | |
| 30 | // Verify that our counter has incremented. |
| 31 | expect(find.text('0'), findsNothing); |
| 32 | expect(find.text('1'), findsOneWidget); |
| 33 | }); |
| 34 | } |