From aaf9d24afd79b071f2b919eb50ba034afd6c3bc4 Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Fri, 18 Oct 2019 08:56:53 -0400 Subject: [PATCH] fix(menu): clamp out of bounds swipe value (#19684) fixes #18927 --- core/src/utils/animation/test/animation.spec.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/core/src/utils/animation/test/animation.spec.ts b/core/src/utils/animation/test/animation.spec.ts index 21c885af55..27b408b939 100644 --- a/core/src/utils/animation/test/animation.spec.ts +++ b/core/src/utils/animation/test/animation.spec.ts @@ -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(); + }) }) });