From b10c805fcdccf2c76bd21d012a432b748744832e Mon Sep 17 00:00:00 2001 From: fazasabira Date: Fri, 28 Feb 2020 20:10:59 +0700 Subject: [PATCH] [RED] making test display list view --- test/pencarian_test.dart | 12 ++++++++++++ test/widget_test.dart | 5 +---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/test/pencarian_test.dart b/test/pencarian_test.dart index 5e553e9..b3a173b 100644 --- a/test/pencarian_test.dart +++ b/test/pencarian_test.dart @@ -8,6 +8,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:ppl_disabilitas/page/dashboard/dashboard.dart'; import 'package:ppl_disabilitas/page/pencarian/pencarian.dart'; @@ -18,4 +19,15 @@ void main() { await tester.pumpWidget(MaterialApp(home: Pencarian())); expect(find.byType(TextFormField), findsOneWidget); }); + + testWidgets('display list view in textfield', (WidgetTester tester) async { + // Provide the childWidget to the Container. + await tester.pumpWidget(MaterialApp(home: Dashboard())); + // Search for the childWidget in the tree and verify it exists. + expect(find.byType(Stack), findsNWidgets(3)); + expect(find.byType(TextFormField), findsOneWidget); + expect(find.byType(Icon), findsNWidgets(3)); + + }); + } diff --git a/test/widget_test.dart b/test/widget_test.dart index 515164a..91e354f 100644 --- a/test/widget_test.dart +++ b/test/widget_test.dart @@ -31,10 +31,7 @@ void main() { expect(find.byType(Dashboard), findsOneWidget); }); -// testWidgets('Display list view in textfield', (WidgetTester tester) async { -// await tester.pumpWidget(MaterialApp(home: Dashboard())); -// expect(find.byKey(), findsOneWidget); -// }); + -- GitLab