完善PR审查后出现的问题

This commit is contained in:
2026-05-31 10:13:36 +08:00
parent 61ad85f6fc
commit 5ee6ba1e28
4 changed files with 161 additions and 50 deletions
+23
View File
@@ -0,0 +1,23 @@
import 'package:cloudreve4_flutter/services/update_service.dart';
import 'package:flutter_test/flutter_test.dart';
void main() {
group('UpdateService', () {
test(
'checkForUpdate releases checking flag when package info fails',
() async {
var calls = 0;
final service = UpdateService.test(
packageInfoProvider: () async {
calls += 1;
throw Exception('package info unavailable');
},
);
expect(await service.checkForUpdate(), isNull);
expect(await service.checkForUpdate(), isNull);
expect(calls, 2);
},
);
});
}