release_schedule/test/view/home_page_test.dart

26 lines
1016 B
Dart
Raw Normal View History

2023-11-16 15:07:33 +01:00
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:release_schedule/api/movie_api.dart';
import 'package:release_schedule/main.dart';
import 'package:release_schedule/model/local_movie_storage.dart';
import 'package:release_schedule/model/movie_manager.dart';
import 'package:release_schedule/view/movie_manager_list.dart';
void main() {
group('HomePage', () {
testWidgets('displays title', (WidgetTester tester) async {
MovieManager movieManager = MovieManager(MovieApi(), LocalMovieStorage());
await tester.pumpWidget(MaterialApp(home: HomePage(movieManager)));
expect(find.text('Release Schedule'), findsOneWidget);
});
testWidgets('displays list of releases', (WidgetTester tester) async {
MovieManager movieManager = MovieManager(MovieApi(), LocalMovieStorage());
await tester.pumpWidget(MaterialApp(home: HomePage(movieManager)));
expect(find.byType(MovieManagerList), findsOneWidget);
});
});
}