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:
1 parent
af1fd868ba
commit
184de87e91
2 files changed
+9
No files matched your search
@@ -177,3 +177,10 @@ export function useUpdateSettings() {
|
||||
resetSettings,
|
||||
};
|
||||
}
|
||||
|
||||
export function __resetClientSettingsPersistenceForTests(): void {
|
||||
clientSettingsSnapshot = DEFAULT_CLIENT_SETTINGS;
|
||||
clientSettingsHydrated = false;
|
||||
clientSettingsHydrationPromise = null;
|
||||
clientSettingsListeners.clear();
|
||||
}
|
||||
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user