Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
test('displays open nav or drawer', () => {
const [appState, appApi] = useAppContext();
useAppContext
.mockReturnValueOnce([
{
...appState,
drawer: 'nav',
overlay: false,
hasBeenOffline: true,
isOnline: true
},
appApi
])
.mockReturnValueOnce([
{
...appState,
drawer: 'cart',
overlay: false,
hasBeenOffline: true,
test('displays onlineIndicator online if hasBeenOffline', () => {
const [appState, appApi] = useAppContext();
useAppContext.mockReturnValueOnce([
{
...appState,
drawer: '',
overlay: false,
hasBeenOffline: true,
isOnline: true
},
appApi
]);
const appProps = {
markErrorHandled: jest.fn(),
unhandledErrors: []
};
createTestInstance();