Refactor app to focus on match results instead of tasks
- Introduced MatchRepository and MatchResultsViewModel to handle match data. - Replaced task-related code with match-related functionality in the app. - Added match results view and updated navigation to reflect changes. - Removed task-related models, services, and view models. - Added JSON data for match results and integrated it into the app. - Updated tests to validate match results loading and UI behavior.
This commit is contained in:
1 parent
ffc2051e20
commit
4d377c1336
17 files changed
+500
-658
No files matched your search
@@ -0,0 +1,23 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:mobile_app/data/repositories/match_repository.dart';
|
||||
import 'package:mobile_app/ui/features/dashboard/view_models/match_results_view_model.dart';
|
||||
|
||||
void main() {
|
||||
TestWidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
test('loads match results and their events from bundled JSON', () async {
|
||||
final viewModel = MatchResultsViewModel(repository: MatchRepository());
|
||||
addTearDown(viewModel.dispose);
|
||||
|
||||
await viewModel.loadMatches();
|
||||
|
||||
expect(viewModel.isLoading, isFalse);
|
||||
expect(viewModel.errorMessage, isNull);
|
||||
expect(viewModel.matches, hasLength(3));
|
||||
expect(viewModel.matches.first.homeScore, 1);
|
||||
expect(viewModel.matches.first.goals, hasLength(2));
|
||||
expect(viewModel.matches.first.goals.first.seconds, 88);
|
||||
expect(viewModel.matches.first.goals.first.team.name, 'away');
|
||||
expect(viewModel.matches.first.cards.first.cardType.name, 'red');
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user