1
0
mirror of https://github.com/immich-app/immich.git synced 2025-08-08 23:07:06 +02:00

refactor(mobile): more repositories (#12879)

* ExifInfoRepository
 * ActivityApiRepository
 * initial AssetApiRepository
This commit is contained in:
Fynn Petersen-Frey
2024-09-24 08:24:48 +02:00
committed by GitHub
parent 56f680ce04
commit e0fa3cdbc7
20 changed files with 392 additions and 193 deletions

View File

@ -1,5 +1,6 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:immich_mobile/models/activities/activity.model.dart';
import 'package:immich_mobile/providers/activity_service.provider.dart';
import 'package:immich_mobile/providers/activity_statistics.provider.dart';
import 'package:mocktail/mocktail.dart';
@ -25,7 +26,7 @@ void main() {
test('Returns the proper count family', () async {
when(
() => activityMock.getStatistics('test-album', assetId: 'test-asset'),
).thenAnswer((_) async => 5);
).thenAnswer((_) async => const ActivityStats(comments: 5));
// Read here to make the getStatistics call
container.read(activityStatisticsProvider('test-album', 'test-asset'));
@ -50,7 +51,7 @@ void main() {
test('Adds activity', () async {
when(
() => activityMock.getStatistics('test-album'),
).thenAnswer((_) async => 10);
).thenAnswer((_) async => const ActivityStats(comments: 10));
final provider = activityStatisticsProvider('test-album');
container.listen(
@ -71,7 +72,7 @@ void main() {
test('Removes activity', () async {
when(
() => activityMock.getStatistics('new-album', assetId: 'test-asset'),
).thenAnswer((_) async => 10);
).thenAnswer((_) async => const ActivityStats(comments: 10));
final provider = activityStatisticsProvider('new-album', 'test-asset');
container.listen(