rusackas commented on code in PR #41303:
URL: https://github.com/apache/superset/pull/41303#discussion_r3456964823
##########
superset-frontend/src/features/home/RightMenu.test.tsx:
##########
@@ -401,6 +401,10 @@ test('Logs out and clears local storage item redux', async
() => {
expect(localStorage.getItem('redux')).not.toBeNull();
expect(sessionStorage.getItem('login_attempted')).not.toBeNull();
+ // Mock the Cache API so we can assert the namespaced store is purged.
+ const deleteMock = jest.fn().mockResolvedValue(true);
+ (global as any).caches = { delete: deleteMock };
Review Comment:
This is already the narrowed `typeof global & { caches?: CacheStorage }`
cast, not `any` — looks like the line numbers drifted. Resolving.
##########
superset-frontend/src/features/home/RightMenu.test.tsx:
##########
@@ -412,6 +416,10 @@ test('Logs out and clears local storage item redux', async
() => {
expect(localStorage.getItem('redux')).toBeNull();
expect(sessionStorage.getItem('login_attempted')).toBeNull();
});
+ // The namespaced Cache API store is purged on logout.
+ expect(deleteMock).toHaveBeenCalledWith('@SUPERSET-UI/CONNECTION');
+
+ delete (global as any).caches;
Review Comment:
Same here — the cleanup already restores the narrowed typed `cacheGlobal`,
no `any`. Resolving.
##########
superset-frontend/src/features/home/RightMenu.test.tsx:
##########
@@ -412,6 +416,10 @@ test('Logs out and clears local storage item redux', async
() => {
expect(localStorage.getItem('redux')).toBeNull();
expect(sessionStorage.getItem('login_attempted')).toBeNull();
});
+ // The namespaced Cache API store is purged on logout.
+ expect(deleteMock).toHaveBeenCalledWith('@SUPERSET-UI/CONNECTION');
+
+ delete (global as any).caches;
Review Comment:
Restoration is already in a `finally` that puts back `priorCaches` (or
deletes only when there was none), so an early throw still cleans up. Resolving.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]