Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests of predefined exiting #6136

Merged
merged 5 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import './tests/utilities/relativeCoords.test';
import './tests/layoutAnimations/entering/enteringColors.test';
import './tests/layoutAnimations/entering/predefinedEntering.test';

import './tests/layoutAnimations/exiting/predefinedExiting.test';

import './tests/advancedAPI/useFrameCallback.test';
// import './tests/advancedAPI/measure.test'; crash on Android

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,15 @@ import {
SpringifyEnteringSnapshots,
} from './entering.snapshot';

const FADE_ENTERING = [FadeIn, FadeInRight, FadeInRight, FadeInLeft, FadeInUp, FadeInDown];
const FADE_ENTERING = [FadeIn, FadeInRight, FadeInLeft, FadeInUp, FadeInDown];
const BOUNCE_ENTERING = [BounceIn, BounceInRight, BounceInLeft, BounceInUp, BounceInDown];
const FLIP_ENTERING = [FlipInEasyX, FlipInEasyY, FlipInXDown, FlipInXUp, FlipInYLeft, FlipInYRight];
const LIGHTSPEED_ENTERING = [LightSpeedInRight, LightSpeedInLeft];
const PINWHEEL_ENTERING = [PinwheelIn];
const ROLL_ENTERING = [RollInRight, RollInLeft]; //Don't test RollIn, until recording rotation snapshot gets fixed
const ROLL_ENTERING = [RollInRight, RollInLeft];
const ROTATE_ENTERING = [RotateInDownLeft, RotateInDownRight, RotateInUpLeft, RotateInUpRight];
const SLIDE_ENTERING = [SlideInRight, SlideInLeft, SlideInUp, SlideInDown];
const STRETCH_ENTERING = [StretchInX, StretchInY];

const ZOOM_ENTERING = [
ZoomIn,
ZoomInDown,
Expand Down Expand Up @@ -117,7 +116,7 @@ async function getSnapshotUpdates(entering: any, waitTime: number, duration: num
}

describe('Test predefined entering', () => {
describe('Entering on mount, no modifiers', async () => {
describe('Entering on mount, no modifiers', () => {
test.each(ENTERING_SETS)('Test suite of ${0}In', async ([_setName, enteringSet, waitTime]) => {
for (const entering of enteringSet) {
const snapshotName = (entering as any).name;
Expand All @@ -129,19 +128,19 @@ describe('Test predefined entering', () => {
});
});

describe('Entering on mount, duration 100', async () => {
describe('Entering on mount, duration 100', () => {
test.each(ENTERING_SETS)('Test suite of ${0}In', async ([_setName, enteringSet, _waitTime]) => {
for (const entering of enteringSet) {
const enteringName: string = (entering as any).name;
let updates = await getSnapshotUpdates(entering, 105, 100);
const updates = await getSnapshotUpdates(entering, 105, 100);
expect(updates).toMatchSnapshots(
DurationEnteringSnapshots[enteringName as keyof typeof DurationEnteringSnapshots],
);
}
});
});

describe('Entering on mount, springify', async () => {
describe('Entering on mount, springify', () => {
test.each(ENTERING_SETS)('Test suite of ${0}In', async ([_setName, enteringSet, waitTime]) => {
const timeToWait = _setName === 'Bounce' ? 650 : waitTime * 0.3;
for (const entering of enteringSet) {
Expand Down
Loading
Loading