Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

Commit

Permalink
Added login test
Browse files Browse the repository at this point in the history
  • Loading branch information
sbis04 committed Sep 21, 2019
1 parent 3c013c2 commit 29a115a
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions test/login_test.dart
@@ -0,0 +1,25 @@
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:sign_in_flutter/login_page.dart';

void main() {
Widget makeTestableWidget({Widget child}) {
return MaterialApp(
home: child,
);
}

testWidgets('Login screen test', (WidgetTester tester) async {
LoginPage loginScreen = LoginPage();

await tester.pumpWidget(makeTestableWidget(child: loginScreen));

expect(find.byType(FlutterLogo), findsOneWidget);
expect(find.byType(OutlineButton), findsOneWidget);
expect(find.text('Sign in with Google'), findsOneWidget);

print('Found Flutter logo.');
print('Button found.');
print('Found the login button text.');
});
}

0 comments on commit 29a115a

Please sign in to comment.