feat(cloud-status): classify blocked accounts and surface validation state

This commit is contained in:
Draculabo committed 2026-04-11 16:46:36 +08:00
1 parent bcdf2a6c24
commit 388fbcb2a9
4 files changed
+137 -8

No files matched your search

+7 -3
View File
@@ -61,7 +61,7 @@ describe('CloudMonitorService', () => {
await pollPromise;
expect(CloudAccountRepo.getAccounts).toHaveBeenCalled();
expect(GoogleAPIService.fetchQuota).toHaveBeenCalledWith('valid_token');
expect(GoogleAPIService.fetchQuota).toHaveBeenCalledWith('valid_token', undefined);
expect(CloudAccountRepo.updateQuota).toHaveBeenCalledWith('acc1', expect.anything());
expect(CloudAccountRepo.updateLastUsed).toHaveBeenCalledWith('acc1');
expect(AutoSwitchService.checkAndSwitchIfNeeded).toHaveBeenCalled();
@@ -93,9 +93,13 @@ describe('CloudMonitorService', () => {
await vi.advanceTimersByTimeAsync(1000);
await pollPromise;
expect(GoogleAPIService.refreshAccessToken).toHaveBeenCalledWith('ref_token');
expect(GoogleAPIService.refreshAccessToken).toHaveBeenCalledWith(
'ref_token',
undefined,
undefined,
);
expect(CloudAccountRepo.updateToken).toHaveBeenCalled();
expect(GoogleAPIService.fetchQuota).toHaveBeenCalledWith('new_token');
expect(GoogleAPIService.fetchQuota).toHaveBeenCalledWith('new_token', undefined);
});
describe('handleAppFocus (Smart Refresh)', () => {