Skip to content

Commit c9f8b34

Browse files
committed
test: add activate/deactivate/refresh/updateStatusBar and integration tests
Cover extension lifecycle (activate, deactivate), refresh auth and error handling paths, updateStatusBar rendering variants, and offline recovery integration flow. Adds test-only exports (_refresh, _updateStatusBar) and extends _setState/_getState for proper test isolation.
1 parent d7ca6aa commit c9f8b34

2 files changed

Lines changed: 463 additions & 0 deletions

File tree

src/extension.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,16 +423,25 @@ module.exports = {
423423
if ("offlineSince" in s) offlineSince = s.offlineSince;
424424
if ("lastData" in s) lastData = s.lastData;
425425
if ("lastUpdatedAt" in s) lastUpdatedAt = s.lastUpdatedAt;
426+
if ("refreshInFlight" in s) refreshInFlight = s.refreshInFlight;
427+
if ("pendingSignIn" in s) pendingSignIn = s.pendingSignIn;
428+
if ("deactivated" in s) deactivated = s.deactivated;
426429
},
427430
_getState: () => ({
428431
isOffline,
429432
offlineSince,
430433
recoveryTimerActive: recoveryActive,
431434
refreshTimerActive: !!refreshTimer,
435+
refreshInFlight,
436+
pendingSignIn,
437+
deactivated,
432438
}),
433439
// Test-only: directly invoke timer lifecycle.
434440
_startRecoveryTimer: startRecoveryTimer,
435441
_clearRecoveryTimer: clearRecoveryTimer,
436442
_resetTimer: resetTimer,
437443
_clearTimer: clearTimer,
444+
// Test-only: exercise core paths that depend on VS Code APIs.
445+
_refresh: (...args) => refresh(...args),
446+
_updateStatusBar: (...args) => updateStatusBar(...args),
438447
};

0 commit comments

Comments
 (0)