26 lines
788 B
TypeScript
26 lines
788 B
TypeScript
import { getMotionContainerPropsForNavigation, STAGGER_FAST } from '../motion';
|
|
|
|
describe('getMotionContainerPropsForNavigation', () => {
|
|
it('returns initial hidden for POP navigation', () => {
|
|
expect(getMotionContainerPropsForNavigation(true, STAGGER_FAST, 'POP')).toEqual({
|
|
variants: STAGGER_FAST,
|
|
initial: 'hidden',
|
|
animate: 'show',
|
|
});
|
|
});
|
|
|
|
it('skips initial animation for PUSH navigation', () => {
|
|
expect(getMotionContainerPropsForNavigation(true, STAGGER_FAST, 'PUSH')).toEqual({
|
|
variants: STAGGER_FAST,
|
|
initial: false,
|
|
animate: 'show',
|
|
});
|
|
});
|
|
|
|
it('disables motion when not enabled', () => {
|
|
expect(getMotionContainerPropsForNavigation(false, STAGGER_FAST, 'POP')).toEqual({
|
|
initial: false,
|
|
});
|
|
});
|
|
});
|