diff --git a/test/widgets/content_test.dart b/test/widgets/content_test.dart index 6658a79..fe47f9f 100644 --- a/test/widgets/content_test.dart +++ b/test/widgets/content_test.dart @@ -64,6 +64,62 @@ void main() { expect(beetrepo.getRow(0).plants[0].id, plant.id,reason: 'Plant drop should be same Plant'); }); + testWidgets('Content widget displays all widgets mobile', + (WidgetTester tester) async { + //Arrange + await tester.pumpWidget( + MaterialApp( + home: Scaffold( + body: + SizedBox( + width: 1080-250, //Sidebar width + height: 2400, + child: + Content( + beetRepository: BeetRepositoryGenerator.getBeetRepository(), + ), + ), + ), + ), + ); + + //Assert + expect(find.byType(Control), findsOneWidget, + reason: 'Control widget is missing'); + expect(find.byType(Dashboard), findsOneWidget, + reason: 'Control widget is missing'); + expect(find.byType(NewBeetRow), findsOneWidget, + reason: 'Control widget is missing'); + expect(find.byType(Footer), findsOneWidget, + reason: 'Control widget is missing'); + }); + + testWidgets('Content widget drop Plant delegate work', + (WidgetTester tester) async { + + final Plant plant = PlantGenerator.getPlant(); + final BeetRepository beetrepo = BeetRepositoryGenerator.getBeetRepository(); + + //Arrange + await tester.pumpWidget( + MaterialApp( + home: Scaffold( + body: Content( + beetRepository: beetrepo, + ), + ), + ), + ); + + //Act + final contentState = tester.state(find.byType(Content)); + contentState.plantDroppedOnRow(0, plant); + + // Assert Plant is Dropped + expect(beetrepo.getRow(0).plants.length, 1,reason: 'No Plant saved'); + expect(beetrepo.getRow(0).plants[0].id, plant.id,reason: 'Plant drop should be same Plant'); + }); + testWidgets('Content widget new Row', (WidgetTester tester) async { final BeetRepository beetrepo = BeetRepositoryGenerator.getBeetRepository();