Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix: local storage test mocks (#32957)

Alaister Youngfb569f9a1352
diff --git a/apps/studio/tests/pages/projects/LogsPreviewer.test.tsx b/apps/studio/tests/pages/projects/LogsPreviewer.test.tsx
index beb0d7e66f3..1c025e11b96 100644
--- a/apps/studio/tests/pages/projects/LogsPreviewer.test.tsx
+++ b/apps/studio/tests/pages/projects/LogsPreviewer.test.tsx
@@ -13,11 +13,15 @@ import { render } from '../../helpers'
// [Joshen] There's gotta be a much better way to mock these things so that it applies for ALL tests
// Since these are easily commonly used things across all pages/components that we might be testing for
-vi.mock('common', () => ({
- useParams: vi.fn().mockReturnValue({}),
- useIsLoggedIn: vi.fn(),
- isBrowser: false,
-}))
+vi.mock('common', async (importOriginal) => {
+ const actual = await importOriginal()
+ return {
+ useParams: vi.fn().mockReturnValue({}),
+ useIsLoggedIn: vi.fn(),
+ isBrowser: false,
+ LOCAL_STORAGE_KEYS: (actual as any).LOCAL_STORAGE_KEYS,
+ }
+})
vi.mock('lib/gotrue', () => ({
auth: { onAuthStateChange: vi.fn() },
}))