GardenPlanner/test/main_test.dart

52 lines
1.6 KiB
Dart
Raw Normal View History

2023-06-25 10:15:30 +02:00
/*
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:garden_planner/main.dart';
import 'package:garden_planner/widgets/content.dart';
import 'package:garden_planner/widgets/sidebar.dart';
import 'helpers/beet_repository_generator.dart';
*/
void main() {
//ToDO Tests fail because of Size in tester. Need to be fixed
/*
testWidgets('App Test', (WidgetTester tester) async {
//Arrange
await tester.pumpWidget(GardenPlanner(beetRepository: BeetRepositoryGenerator.getBeetRepository()));
// Assert
expect(find.byType(Sidebar), findsOneWidget, reason: 'Sidebar is missing');
expect(find.byType(Content), findsOneWidget, reason: 'Content is missing');
});
testWidgets('App Test sidbar opens', (WidgetTester tester) async {
//Arrange
await tester.pumpWidget(GardenPlanner(beetRepository: BeetRepositoryGenerator.getBeetRepository()));
// Act
await tester.tap(find.byIcon(Icons.menu));
await tester.pumpAndSettle();
await tester.tap(find.byIcon(Icons.menu));
await tester.pumpAndSettle();
// Assert
expect(find.byType(Sidebar), findsOneWidget, reason: 'Sidebar displayed');
});
testWidgets('App Test sidbar close', (WidgetTester tester) async {
//Arrange
await tester.pumpWidget(GardenPlanner(beetRepository: BeetRepositoryGenerator.getBeetRepository()));
// Act
await tester.tap(find.byIcon(Icons.menu));
await tester.pumpAndSettle();
//Assert
expect(find.byType(Sidebar), findsNothing);
expect(find.byType(Content), findsOneWidget);
});*/
}