From 1dada29159cb29604be92f59bbe95adb10f02dd2 Mon Sep 17 00:00:00 2001 From: riya Date: Thu, 4 Jun 2026 00:30:44 +0530 Subject: [PATCH 1/2] test(statscard): add type compiler validation tests --- components/dashboard/StatsCard.tsx | 2 +- .../StatsCard.type-compiler.test.tsx | 33 +++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 components/dashboard/StatsCard.type-compiler.test.tsx diff --git a/components/dashboard/StatsCard.tsx b/components/dashboard/StatsCard.tsx index 0d5ab2b9b..42ec76f62 100644 --- a/components/dashboard/StatsCard.tsx +++ b/components/dashboard/StatsCard.tsx @@ -9,7 +9,7 @@ const iconMap: Record = { GitCommit, }; -interface StatsCardProps { +export interface StatsCardProps { title: string; value: string; description: string; diff --git a/components/dashboard/StatsCard.type-compiler.test.tsx b/components/dashboard/StatsCard.type-compiler.test.tsx new file mode 100644 index 000000000..6ee370fb2 --- /dev/null +++ b/components/dashboard/StatsCard.type-compiler.test.tsx @@ -0,0 +1,33 @@ +import { describe, it, expectTypeOf } from 'vitest'; +import type { StatsCardProps } from './StatsCard'; + +describe('StatsCard Type Compiler Validation', () => { + it('accepts valid props shape', () => { + expectTypeOf().toMatchTypeOf<{ + title: string; + value: string; + description: string; + icon: string; + showUTCDisclaimer?: boolean; + utcDate?: string; + }>(); + }); + + it('requires title as string', () => { + expectTypeOf().toEqualTypeOf(); + }); + + it('requires value as string', () => { + expectTypeOf().toEqualTypeOf(); + }); + + it('requires description as string', () => { + expectTypeOf().toEqualTypeOf(); + }); + + it('allows optional UTC fields', () => { + expectTypeOf().toEqualTypeOf(); + + expectTypeOf().toEqualTypeOf(); + }); +}); From 5df736e0279b72814a7d76e55aa80fda12630b1c Mon Sep 17 00:00:00 2001 From: riya Date: Thu, 4 Jun 2026 01:31:52 +0530 Subject: [PATCH 2/2] test(cherryblossom): add massive scaling validation tests --- .../CherryBlossom.massive-scaling.test.tsx | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 components/CherryBlossom.massive-scaling.test.tsx diff --git a/components/CherryBlossom.massive-scaling.test.tsx b/components/CherryBlossom.massive-scaling.test.tsx new file mode 100644 index 000000000..9a1883971 --- /dev/null +++ b/components/CherryBlossom.massive-scaling.test.tsx @@ -0,0 +1,37 @@ +import { describe, it, expect } from 'vitest'; +import { render } from '@testing-library/react'; +import CherryBlossom from './CherryBlossom'; + +describe('CherryBlossom Massive Scaling', () => { + it('renders without crashing', () => { + const { container } = render(); + expect(container).toBeTruthy(); + }); + + it('renders svg elements', () => { + const { container } = render(); + expect(container.querySelectorAll('svg').length).toBeGreaterThan(0); + }); + + it('renders petal paths', () => { + const { container } = render(); + expect(container.querySelectorAll('path').length).toBeGreaterThan(0); + }); + + it('supports multiple renders without errors', () => { + for (let i = 0; i < 20; i++) { + const { container } = render(); + expect(container).toBeTruthy(); + } + }); + + it('maintains stable structure during repeated renders', () => { + const { container, rerender } = render(); + + for (let i = 0; i < 50; i++) { + rerender(); + } + + expect(container.querySelectorAll('svg').length).toBeGreaterThan(0); + }); +});