d7fee66d89
* feat: [console-lite] - calculate slippage (price impact) * feat: [console-lite] - move slippage from estimates to deal-ticket-size * feat: [console-lite] - slippage - add a bunch of unit tests * feat: [console-lite] - slippage - * feat: [console-lite] - slippage - fix some faillings, add enum instead text entry * feat: [console-lite] - slippage - adjust tooltip info text * feat: [console-lite] - slippage - fix failling cache * feat: [console-lite] - slippage - resolve conflicts after rebase * feat: [console-lite] - slippage - fixes after review * feat: [console-lite] - slippage - fixes after review * feat: [console-lite] - slippage - add memo back to the hook * feat: [console-lite] - slippage - add back order book model outside hook * feat: [console-lite] - slippage - adjust some int test * feat: [console-lite] - slippage - adjust some int test Co-authored-by: maciek <maciek@vegaprotocol.io>
19 lines
780 B
TypeScript
19 lines
780 B
TypeScript
import { renderHook, act } from '@testing-library/react';
|
|
import useLocalValues from './use-local-values';
|
|
|
|
describe('local values hook', () => {
|
|
it('state of wallet dialog should be properly handled', () => {
|
|
const setTheme = jest.fn();
|
|
const { result } = renderHook(() => useLocalValues('light', setTheme));
|
|
expect(result.current.vegaWalletDialog).toBeDefined();
|
|
expect(result.current.vegaWalletDialog.manage).toBe(false);
|
|
expect(result.current.vegaWalletDialog.connect).toBe(false);
|
|
act(() => {
|
|
result.current.vegaWalletDialog.setConnect(true);
|
|
result.current.vegaWalletDialog.setManage(true);
|
|
});
|
|
expect(result.current.vegaWalletDialog.manage).toBe(true);
|
|
expect(result.current.vegaWalletDialog.connect).toBe(true);
|
|
});
|
|
});
|