mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
refactor(mobile): move timeline methods to timeline repo (#16526)
* refactor: move timeline calls to timeline repo * refactor: review changes --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
parent
3d6a6f77a8
commit
4db8f0c666
12 changed files with 64 additions and 61 deletions
|
|
@ -2,6 +2,7 @@ import 'package:flutter_test/flutter_test.dart';
|
|||
import 'package:immich_mobile/entities/backup_album.entity.dart';
|
||||
import 'package:immich_mobile/services/album.service.dart';
|
||||
import 'package:mocktail/mocktail.dart';
|
||||
|
||||
import '../fixtures/album.stub.dart';
|
||||
import '../fixtures/asset.stub.dart';
|
||||
import '../fixtures/user.stub.dart';
|
||||
|
|
@ -83,7 +84,9 @@ void main() {
|
|||
|
||||
group('refreshRemoteAlbums', () {
|
||||
test('is working', () async {
|
||||
when(() => userService.refreshUsers()).thenAnswer((_) async => true);
|
||||
when(() => userService.getUsersFromServer()).thenAnswer((_) async => []);
|
||||
when(() => syncService.syncUsersFromServer(any()))
|
||||
.thenAnswer((_) async => true);
|
||||
when(() => albumApiRepository.getAll(shared: true))
|
||||
.thenAnswer((_) async => [AlbumStub.sharedWithUser]);
|
||||
|
||||
|
|
@ -99,7 +102,8 @@ void main() {
|
|||
).thenAnswer((_) async => true);
|
||||
final result = await sut.refreshRemoteAlbums();
|
||||
expect(result, true);
|
||||
verify(() => userService.refreshUsers()).called(1);
|
||||
verify(() => userService.getUsersFromServer()).called(1);
|
||||
verify(() => syncService.syncUsersFromServer([])).called(1);
|
||||
verify(() => albumApiRepository.getAll(shared: true)).called(1);
|
||||
verify(() => albumApiRepository.getAll(shared: null)).called(1);
|
||||
verify(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue