testing has commenced

adding accessibility options now
This commit is contained in:
Felix 2019-08-19 11:54:12 +01:00
parent ff7cdf4907
commit d0defec7d6
2 changed files with 8 additions and 10 deletions

View file

@ -470,6 +470,7 @@ class ReceiptPage2State extends State<ReceiptPage2> {
} }
}, },
child: Text("GO", child: Text("GO",
key: Key("goButton"),
style: style:
TextStyle(color: Colors.white, fontSize: 22.0)), TextStyle(color: Colors.white, fontSize: 22.0)),
color: Colors.blue, color: Colors.blue,

View file

@ -11,20 +11,17 @@ import 'package:flutter_test/flutter_test.dart';
import 'package:local_spend/main.dart'; import 'package:local_spend/main.dart';
void main() { void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
testWidgets('GO button repetition test', (WidgetTester tester) async {
// Build our app and trigger a frame. // Build our app and trigger a frame.
await tester.pumpWidget(MyApp()); await tester.pumpWidget(MyApp());
// Verify that our counter starts at 0. // Tap the GO button and trigger a frame.
expect(find.text('0'), findsOneWidget); await tester.tap(find.byKey(Key("goButton")));
expect(find.text('1'), findsNothing);
// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump(); await tester.pump();
// Verify that our counter has incremented. // Verify that the dialog has shown
expect(find.text('0'), findsNothing); // expect(find.text('GO'), findsNothing);
expect(find.text('1'), findsOneWidget); // expect(find.text('Invalid data'), findsOneWidget);
}); });
} }