From 301c51ac84118ea540bee93c61ce310a36d5fb3d Mon Sep 17 00:00:00 2001 From: Amit Haridas Date: Fri, 5 Jun 2026 09:36:18 +0530 Subject: [PATCH] test(renderer): add failing test for motion presets --- tests/unit/lib/motion.test.ts | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 tests/unit/lib/motion.test.ts diff --git a/tests/unit/lib/motion.test.ts b/tests/unit/lib/motion.test.ts new file mode 100644 index 0000000..ee731de --- /dev/null +++ b/tests/unit/lib/motion.test.ts @@ -0,0 +1,32 @@ +import { describe, it, expect } from 'vitest'; +import { + fadeIn, + slideInRight, + modalPop, + toastSpring, + sidebarToggle, +} from '@/lib/motion'; + +describe('motion presets', () => { + it('fadeIn is a valid transition object', () => { + expect(fadeIn.duration).toBeGreaterThan(0); + expect(fadeIn.ease).toBeDefined(); + }); + + it('slideInRight uses translateX transform', () => { + expect(slideInRight.x).toBe('100%'); + }); + + it('modalPop uses scale and opacity', () => { + expect(modalPop.scale).toBeDefined(); + expect(modalPop.opacity).toBeDefined(); + }); + + it('toastSpring has spring physics', () => { + expect(toastSpring.type).toBe('spring'); + }); + + it('sidebarToggle animates width', () => { + expect(sidebarToggle.width.duration).toBeGreaterThan(0); + }); +});