Modernize gallery UI and fix nav motion
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { getMotionContainerPropsForNavigation, STAGGER_FAST } from '../motion';
|
||||
import { getMotionContainerPropsForNavigation, getMotionItemPropsForNavigation, STAGGER_FAST, FADE_UP } from '../motion';
|
||||
|
||||
describe('getMotionContainerPropsForNavigation', () => {
|
||||
it('returns initial hidden for POP navigation', () => {
|
||||
@@ -23,3 +23,25 @@ describe('getMotionContainerPropsForNavigation', () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('getMotionItemPropsForNavigation', () => {
|
||||
it('returns animate props for POP navigation', () => {
|
||||
expect(getMotionItemPropsForNavigation(true, FADE_UP, 'POP')).toEqual({
|
||||
variants: FADE_UP,
|
||||
initial: 'hidden',
|
||||
animate: 'show',
|
||||
});
|
||||
});
|
||||
|
||||
it('skips initial animation for PUSH navigation', () => {
|
||||
expect(getMotionItemPropsForNavigation(true, FADE_UP, 'PUSH')).toEqual({
|
||||
variants: FADE_UP,
|
||||
initial: false,
|
||||
animate: 'show',
|
||||
});
|
||||
});
|
||||
|
||||
it('returns empty props when motion disabled', () => {
|
||||
expect(getMotionItemPropsForNavigation(false, FADE_UP, 'POP')).toEqual({});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user