From e5e9dd5dfe032b04a01a25e7bac180df09f7d234 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 6ecf4ed8ca..e6fd267e67 100644 --- a/core/src/utils/animation/test/animation.spec.ts +++ b/core/src/utils/animation/test/animation.spec.ts @@ -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(); + }) }) });