Reset client settings persistence in test teardown

- add a test-only reset helper for cached settings state
- clear client settings persistence when resetting the local API
This commit is contained in:
Julius Marminge committed 2026-04-09 19:46:46 -07:00
1 parent af1fd868ba
commit 184de87e91
2 files changed
+9

No files matched your search

+7
View File
@@ -177,3 +177,10 @@ export function useUpdateSettings() {
resetSettings,
};
}
export function __resetClientSettingsPersistenceForTests(): void {
clientSettingsSnapshot = DEFAULT_CLIENT_SETTINGS;
clientSettingsHydrated = false;
clientSettingsHydrationPromise = null;
clientSettingsListeners.clear();
}
+2
View File
@@ -142,6 +142,8 @@ export function ensureLocalApi(): LocalApi {
export async function __resetLocalApiForTests() {
cachedApi = undefined;
const { __resetClientSettingsPersistenceForTests } = await import("./hooks/useSettings");
__resetClientSettingsPersistenceForTests();
await resetEnvironmentServiceForTests();
resetGitStatusStateForTests();
resetRequestLatencyStateForTests();