fix(menu): clamp out of bounds swipe value (#19684)

fixes #18927
This commit is contained in:
Liam DeBeasi
2019-10-18 08:56:53 -04:00
committed by Ely Lucas
parent a3666ddf0c
commit e5e9dd5dfe

View File

@ -385,6 +385,18 @@ describe('cubic-bezier conversion', () => {
shouldApproximatelyEqual(getTimeGivenProgression(...equation, 1.02), [0.35, 0.87]);
})
it('cubic-bezier(0.32, 0.72, 0, 1) (with out of bounds progression)', () => {
const equation = [
new Point(0, 0),
new Point(0.05, 0.2),
new Point(.14, 1.72),
new Point(1, 1)
];
expect(getTimeGivenProgression(...equation, 1.32)).toBeNaN();
expect(getTimeGivenProgression(...equation, -0.32)).toBeNaN();
})
})
});