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 4c8f32fae9
commit aaf9d24afd

View File

@@ -397,6 +397,18 @@ describe('cubic-bezier conversion', () => {
expect(getTimeGivenProgression(...equation, 1.32)).toEqual([]);
expect(getTimeGivenProgression(...equation, -0.32)).toEqual([]);
})
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();
})
})
});