mirror of
https://github.com/supabase/supabase.git
synced 2026-10-07 02:15:05 +03:00
* feat: groundwork for disabling features * update to use profile endpoint & disable features * fix ts error * add useIsFeatureEnabled mock * fix merge conflicts * fix test * upgrade to pro * prettier * add more billing enabled feature checks * disable more stuff * update useIsFeatureEnabled hook * Fix database reports disk size * Fix database reports disk size * disable log sources * disable moar things * Tiny fix --------- Co-authored-by: Kevin Grüneberg <k.grueneberg1994@gmail.com> Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
32 lines
916 B
JavaScript
32 lines
916 B
JavaScript
export const useFlag = jest.fn().mockReturnValue(true)
|
|
export const useCheckPermissions = jest.fn().mockReturnValue(true)
|
|
|
|
const { useStore: _useStore, StoreProvider: _StoreProvider } = jest.requireActual('hooks')
|
|
export const useStore = _useStore
|
|
|
|
export const useParams = jest.fn().mockImplementation(() => ({ ref: '123' }))
|
|
|
|
export const useLocalStorage = jest.fn().mockImplementation(() => [[], jest.fn()])
|
|
|
|
export const useIsFeatureEnabled = jest.fn().mockImplementation((arg) =>
|
|
typeof arg === 'string'
|
|
? true
|
|
: new Proxy(
|
|
{},
|
|
{
|
|
get() {
|
|
// Always return true, regardless of the property name
|
|
return true
|
|
},
|
|
}
|
|
)
|
|
)
|
|
|
|
// mocks browser event listener adding/removing
|
|
window.matchMedia = jest.fn().mockReturnValue({
|
|
removeEventListener: jest.fn(),
|
|
})
|
|
export const StoreProvider = _StoreProvider
|
|
|
|
export const withAuth = jest.fn()
|