Skip to content

Commit

Permalink
Added new widget tests for home screen and renamed and grouped for re…
Browse files Browse the repository at this point in the history
…adibility
  • Loading branch information
yashovardhan99 committed Mar 10, 2019
1 parent 78c0335 commit 09fe919
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 9 deletions.
9 changes: 0 additions & 9 deletions test/app_test.dart

This file was deleted.

26 changes: 26 additions & 0 deletions test/home_screen_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import 'package:allisto_app/pages/home_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

void main() {
group("Home screen is displayed correctly", () {
testWidgets('Home screen has text Allisto', (tester) async {
await tester.pumpWidget(new MaterialApp(home: HomePage(),));
expect(find.text('Allisto'), findsOneWidget);
});
testWidgets('Home screen has mic button', (tester) async {
await tester.pumpWidget(new MaterialApp(home: HomePage(),));
expect(find.widgetWithIcon(FloatingActionButton, Icons.mic_none),
findsOneWidget);
});
testWidgets('Home screen has dashboard button', (tester) async {
await tester.pumpWidget(new MaterialApp(home: HomePage(),));
expect(find.widgetWithIcon(IconButton, Icons.dashboard), findsOneWidget);
});
testWidgets('Home screen has contact button', (tester) async {
await tester.pumpWidget(new MaterialApp(home: HomePage(),));
expect(find.widgetWithIcon(IconButton, Icons.perm_contact_calendar),
findsOneWidget);
});
});
}

0 comments on commit 09fe919

Please sign in to comment.