Skip to content

Commit

Permalink
Merge branch 'main' into @mbert/custom-keyframes
Browse files Browse the repository at this point in the history
  • Loading branch information
m-bert committed Jun 21, 2024
2 parents 55aab5e + 85dee03 commit 28f9f72
Show file tree
Hide file tree
Showing 4 changed files with 329 additions and 7 deletions.
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

0 comments on commit 28f9f72

Please sign in to comment.