Skip to content

Commit

Permalink
[Application] Only show the targetResourceVersion when an update is a…
Browse files Browse the repository at this point in the history
…vailable
  • Loading branch information
Wolfteam committed Mar 30, 2023
1 parent 0849e1f commit 0720cb8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ class CheckForResourceUpdatesBloc extends Bloc<CheckForResourceUpdatesEvent, Che
return CheckForResourceUpdatesState.loaded(
updateResultType: result.type,
currentResourceVersion: _settingsService.resourceVersion,
targetResourceVersion: result.resourceVersion == _settingsService.resourceVersion ? null : result.resourceVersion,
targetResourceVersion: result.resourceVersion == _settingsService.resourceVersion || result.type != AppResourceUpdateResultType.updatesAvailable
? null
: result.resourceVersion,
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void main() {
act: (bloc) => bloc
..add(const CheckForResourceUpdatesEvent.init())
..add(const CheckForResourceUpdatesEvent.checkForUpdates()),
verify: (bloc) => checkState(bloc.state, AppResourceUpdateResultType.needsLatestAppVersion, -1, targetResourceVersion: 2),
verify: (bloc) => checkState(bloc.state, AppResourceUpdateResultType.needsLatestAppVersion, -1),
);

blocTest<CheckForResourceUpdatesBloc, CheckForResourceUpdatesState>(
Expand All @@ -110,7 +110,7 @@ void main() {
act: (bloc) => bloc
..add(const CheckForResourceUpdatesEvent.init())
..add(const CheckForResourceUpdatesEvent.checkForUpdates()),
verify: (bloc) => checkState(bloc.state, AppResourceUpdateResultType.noInternetConnectionForFirstInstall, -1, targetResourceVersion: 2),
verify: (bloc) => checkState(bloc.state, AppResourceUpdateResultType.noInternetConnectionForFirstInstall, -1),
);

blocTest<CheckForResourceUpdatesBloc, CheckForResourceUpdatesState>(
Expand Down
4 changes: 1 addition & 3 deletions test/infrastructure/file/character_file_service_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,7 @@ void main() {
expect(detail.role, character.roleType);
expect(detail.isComingSoon, character.isComingSoon);
expect(detail.isNew, character.isNew);
if (detail.isComingSoon) {
expect(detail.tier, 'na');
} else {
if (!detail.isComingSoon) {
expect(detail.tier, isIn(['d', 'c', 'b', 'a', 's', 'ss', 'sss']));
}

Expand Down

0 comments on commit 0720cb8

Please sign in to comment.