From 33c95a97f756e7c30b28319e365897b3b7b1e037 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Fri, 5 Jun 2020 19:51:04 +0530 Subject: Test changes --- test/components/SearchableAppList_test.dart | 35 +++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 test/components/SearchableAppList_test.dart (limited to 'test/components/SearchableAppList_test.dart') diff --git a/test/components/SearchableAppList_test.dart b/test/components/SearchableAppList_test.dart new file mode 100644 index 0000000..c4f520c --- /dev/null +++ b/test/components/SearchableAppList_test.dart @@ -0,0 +1,35 @@ +import 'dart:async'; +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:device_apps/device_apps.dart'; + +import 'package:owyn/components/SearchableAppList.dart'; +import 'package:owyn/components/AppList.dart'; + +import '../utils.dart'; + +void main() { + List appList = [ + makeApp('Reddit', 'org.example.reddit'), + makeApp('Spotify', 'org.example.spotify'), + makeApp('Twitter', 'org.example.twitter'), + makeApp('Youtube', 'org.example.youtube'), + ]; + var appListF = Future.value(appList); + + testWidgets('Should render nothing for empty list', (WidgetTester tester) async { + await tester.pumpWidget(wrapper(SearchableAppList(appListF: Future.value([])))); + await tester.pump(); + + expect(find.byType(AppList), findsOneWidget); + expect(find.byType(ListTile), findsNothing); + }); + + //testWidgets('Should render nothing for a of list 4 items', (WidgetTester tester) async { + //await tester.pumpWidget(wrapper(SearchableAppList(appListF: appListF))); + //await tester.pumpAndSettle(); + + //expect(find.byType(AppList), findsOneWidget); + //expect(find.byType(ListTile), findsNWidgets(4)); + //}); +} -- cgit v1.3.1