26 lines
737 B
TypeScript
26 lines
737 B
TypeScript
/**
|
|
* hooks/useHideTabNav.ts — hides the tab bar for a caller via appStore.
|
|
*/
|
|
|
|
import { renderHook } from '@testing-library/react-native'
|
|
|
|
import { useHideTabNav } from '@/src/hooks/useHideTabNav'
|
|
import { useAppStore } from '@/src/store/appStore'
|
|
|
|
describe('useHideTabNav', () => {
|
|
it('marks the tab bar hidden for the caller key on focus', () => {
|
|
useAppStore.setState({ hideTabsNav: {} })
|
|
|
|
renderHook(() => useHideTabNav('cart'))
|
|
|
|
expect(useAppStore.getState().hideTabsNav.cart).toBe(true)
|
|
})
|
|
|
|
it('defaults the caller key when none is given', () => {
|
|
useAppStore.setState({ hideTabsNav: {} })
|
|
|
|
renderHook(() => useHideTabNav())
|
|
|
|
expect(useAppStore.getState().hideTabsNav.default).toBe(true)
|
|
})
|
|
})
|