From 5fa0833444732e988fc8fa56e7b7074dd5430455 Mon Sep 17 00:00:00 2001 From: gamana618 Date: Wed, 3 Jun 2026 00:56:26 +0530 Subject: [PATCH] test(theme-switch): add component animation tests --- app/components/theme-switch.test.tsx | 40 ++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 app/components/theme-switch.test.tsx diff --git a/app/components/theme-switch.test.tsx b/app/components/theme-switch.test.tsx new file mode 100644 index 000000000..a7768145b --- /dev/null +++ b/app/components/theme-switch.test.tsx @@ -0,0 +1,40 @@ +import { describe, it, expect } from 'vitest'; +import { createAnimation } from './theme-switch'; + +describe('ThemeSwitch', () => { + it('creates a circle animation', () => { + const animation = createAnimation('circle', 'center'); + + expect(animation).toBeDefined(); + expect(animation.name).toContain('circle'); + expect(typeof animation.css).toBe('string'); + }); + + it('creates a rectangle animation', () => { + const animation = createAnimation('rectangle', 'top-left'); + + expect(animation.name).toContain('rectangle'); + expect(typeof animation.css).toBe('string'); + }); + + it('creates a polygon animation', () => { + const animation = createAnimation('polygon', 'top-right'); + + expect(animation.name).toContain('polygon'); + expect(typeof animation.css).toBe('string'); + }); + + it('creates a gif animation', () => { + const animation = createAnimation('gif', 'center', false, 'test.gif'); + + expect(animation.name).toContain('gif'); + expect(typeof animation.css).toBe('string'); + }); + + it('returns name and css properties', () => { + const animation = createAnimation('circle'); + + expect(animation).toHaveProperty('name'); + expect(animation).toHaveProperty('css'); + }); +});