fix: backport 'reset storage before setting a guided target' to 24.04 (#1127)

Backport of #986
This commit is contained in:
Dennis Loose
2025-07-18 14:58:29 +02:00
committed by GitHub
2 changed files with 5 additions and 0 deletions

View File

@ -87,6 +87,7 @@ class StorageService {
/// Sets the selected target for guided partitioning.
Future<void> setGuidedStorage() async {
await _client.resetStorageV2();
await _client.setGuidedStorageV2(
GuidedChoiceV2(
target: guidedTarget!,

View File

@ -34,6 +34,8 @@ void main() {
state: ApplicationState.RUNNING,
),
);
when(client.resetStorageV2())
.thenAnswer((_) async => fakeStorageResponse());
});
test('get guided storage', () async {
@ -62,6 +64,7 @@ void main() {
final service = StorageService(client);
service.guidedTarget = target;
await service.setGuidedStorage();
verify(client.resetStorageV2()).called(1);
verify(client.setGuidedStorageV2(choice)).called(1);
verify(client.setStorageV2()).called(1);
});
@ -85,6 +88,7 @@ void main() {
service.guidedTarget = target;
await service.setGuidedStorage();
verify(client.resetStorageV2()).called(1);
verify(client.setGuidedStorageV2(choice)).called(1);
verify(client.setStorageV2()).called(1);
});