Skip to content

Commit

Permalink
Merge pull request #2 from allisto/topic-addTests
Browse files Browse the repository at this point in the history
added some homescreen widget tests
  • Loading branch information
yashovardhan99 authored Mar 10, 2019
2 parents 6b9c17d + 09fe919 commit bb3ae27
Showing 1 changed file with 26 additions and 0 deletions.
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 bb3ae27

Please sign in to comment.