Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions components/CherryBlossom.massive-scaling.test.tsx
Original file line number Diff line number Diff line change
@@ -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(<CherryBlossom />);
expect(container).toBeTruthy();
});

it('renders svg elements', () => {
const { container } = render(<CherryBlossom />);
expect(container.querySelectorAll('svg').length).toBeGreaterThan(0);
});

it('renders petal paths', () => {
const { container } = render(<CherryBlossom />);
expect(container.querySelectorAll('path').length).toBeGreaterThan(0);
});

it('supports multiple renders without errors', () => {
for (let i = 0; i < 20; i++) {
const { container } = render(<CherryBlossom />);
expect(container).toBeTruthy();
}
});

it('maintains stable structure during repeated renders', () => {
const { container, rerender } = render(<CherryBlossom />);

for (let i = 0; i < 50; i++) {
rerender(<CherryBlossom />);
}

expect(container.querySelectorAll('svg').length).toBeGreaterThan(0);
});
});
6 changes: 1 addition & 5 deletions components/dashboard/StatsCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ const iconMap: Record<string, LucideIcon> = {
GitCommit,
};

export function buildMiniChart(seed: number): number[] {
return Array.from({ length: 12 }).map((_, i) => ((seed * 17 + i * 31) % 100) + (i > 6 ? 40 : 0));
}

interface StatsCardProps {
export interface StatsCardProps {
title: string;
value: string;
description: string;
Expand Down
33 changes: 33 additions & 0 deletions components/dashboard/StatsCard.type-compiler.test.tsx
Original file line number Diff line number Diff line change
@@ -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<StatsCardProps>().toMatchTypeOf<{
title: string;
value: string;
description: string;
icon: string;
showUTCDisclaimer?: boolean;
utcDate?: string;
}>();
});

it('requires title as string', () => {
expectTypeOf<StatsCardProps['title']>().toEqualTypeOf<string>();
});

it('requires value as string', () => {
expectTypeOf<StatsCardProps['value']>().toEqualTypeOf<string>();
});

it('requires description as string', () => {
expectTypeOf<StatsCardProps['description']>().toEqualTypeOf<string>();
});

it('allows optional UTC fields', () => {
expectTypeOf<StatsCardProps['showUTCDisclaimer']>().toEqualTypeOf<boolean | undefined>();

expectTypeOf<StatsCardProps['utcDate']>().toEqualTypeOf<string | undefined>();
});
});
Loading