* Add jest tests for twenty-front Co-authored-by: v1b3m <vibenjamin6@gmail.com> * Fix tests --------- Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com> Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: Charles Bochet <charles@twenty.com>
24 lines
556 B
TypeScript
24 lines
556 B
TypeScript
import { renderHook } from '@testing-library/react';
|
|
|
|
import { useFirstMountState } from '~/hooks/useFirstMountState';
|
|
|
|
describe('useFirstMountState', () => {
|
|
it('should return true on first mount', () => {
|
|
const { result } = renderHook(() => {
|
|
return useFirstMountState();
|
|
});
|
|
|
|
expect(result.current).toBe(true);
|
|
});
|
|
|
|
it('should return false on second mount', () => {
|
|
const { result, rerender } = renderHook(() => {
|
|
return useFirstMountState();
|
|
});
|
|
|
|
rerender();
|
|
|
|
expect(result.current).toBe(false);
|
|
});
|
|
});
|