Skip to content

Commit

Permalink
fix(mobile): mobile album sort not persisting (immich-app#5584)
Browse files Browse the repository at this point in the history
* chore(deps): use mocktail instead of mockito

* refactor: move stubs to fixtures/

* fix: fetch assetsortmode based on storeindex

* test: validate AlbumSortByOptions provider

---------

Co-authored-by: shenlong-tanwen <[email protected]>
  • Loading branch information
shenlong-tanwen and shenlong-tanwen authored Dec 10, 2023
1 parent 188cdf9 commit 8847ebe
Show file tree
Hide file tree
Showing 11 changed files with 362 additions and 142 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ coverage
mobile/gradle.properties
mobile/openapi/pubspec.lock
mobile/*.jks
mobile/libisar.dylib
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class AlbumSortByOptions extends _$AlbumSortByOptions {
.watch(appSettingsServiceProvider)
.getSetting(AppSettingsEnum.selectedAlbumSortOrder);
return AlbumSortMode.values.firstWhere(
(e) => e.index == sortOpt,
(e) => e.storeIndex == sortOpt,
orElse: () => AlbumSortMode.title,
);
}
Expand Down
10 changes: 5 additions & 5 deletions mobile/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -964,14 +964,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.4"
mockito:
dependency: "direct dev"
mocktail:
dependency: "direct main"
description:
name: mockito
sha256: "7d5b53bcd556c1bc7ffbe4e4d5a19c3e112b7e925e9e172dd7c6ad0630812616"
name: mocktail
sha256: bac151b31e4ed78bd59ab89aa4c0928f297b1180186d5daf03734519e5f596c1
url: "https://pub.dev"
source: hosted
version: "5.4.2"
version: "1.0.1"
nested:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion mobile/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ dependencies:
wakelock_plus: ^1.1.1
flutter_local_notifications: ^15.1.0+1
timezone: ^0.9.2
mocktail: ^1.0.1

openapi:
path: openapi
Expand All @@ -84,7 +85,6 @@ dev_dependencies:
flutter_launcher_icons: "^0.9.2"
flutter_native_splash: ^2.2.16
isar_generator: *isar_version
mockito: ^5.3.2
integration_test:
sdk: flutter
custom_lint: ^0.5.6
Expand Down
Loading

0 comments on commit 8847ebe

Please sign in to comment.