Skip to content

Commit 5f6e285

Browse files
authored
fix: replace mojibake UTC disclaimer prefix in dashboard stats card (JhaSourav07#2219)
## Description This PR fixes the broken UTC disclaimer prefix in `components/dashboard/StatsCard.tsx` by replacing the mojibake-rendered decorative prefix with a clean info symbol. It keeps the existing disclaimer copy and UTC date rendering intact, and adds a focused regression test for the disclaimer output. Fixes JhaSourav07#2218 ## Pillar UI polish and accessibility improvements ## Checklist - [x] I read the contributing guide - [x] I kept the change small and focused - [x] I added a focused regression test - [x] I ran local tests - [x] I ran linting for the touched files - [ ] I verified Vercel deployment (maintainer authorization required on this repo) ## Testing - `npm test -- StatsCard.test.tsx` - `npx eslint components/dashboard/StatsCard.tsx components/dashboard/StatsCard.test.tsx`
2 parents 348372a + 20f370b commit 5f6e285

2 files changed

Lines changed: 42 additions & 1 deletion

File tree

components/dashboard/StatsCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export default function StatsCard({
6565
{showUTCDisclaimer && (
6666
<div className="mt-3 space-y-1">
6767
<p className="text-[11px] text-[#71717A] leading-relaxed">
68-
Streaks are calculated in UTC and may differ from your local timezone.
68+
ℹ Streaks are calculated in UTC and may differ from your local timezone.
6969
</p>
7070

7171
{utcDate && <p className="text-[10px] text-[#52525B]">UTC Date: {utcDate}</p>}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/* eslint-disable @typescript-eslint/no-explicit-any */
2+
import { describe, expect, it, vi } from 'vitest';
3+
import { render } from '@testing-library/react';
4+
import StatsCard from './StatsCard';
5+
6+
vi.mock('framer-motion', () => ({
7+
motion: {
8+
div: ({ children, className, ...props }: any) => {
9+
delete props.initial;
10+
delete props.whileInView;
11+
delete props.viewport;
12+
delete props.whileHover;
13+
delete props.transition;
14+
15+
return (
16+
<div className={className} {...props}>
17+
{children}
18+
</div>
19+
);
20+
},
21+
},
22+
}));
23+
24+
describe('StatsCard UTC disclaimer', () => {
25+
it('renders a clean UTC disclaimer prefix and preserves the UTC date text', () => {
26+
const { container } = render(
27+
<StatsCard
28+
title="Current Streak"
29+
value="12"
30+
description="Consecutive contribution days"
31+
icon="Flame"
32+
showUTCDisclaimer
33+
utcDate="2026-06-01"
34+
/>
35+
);
36+
37+
expect(container.textContent).toContain('ℹ');
38+
expect(container.textContent).not.toContain('\u00E2\u20AC\u2039');
39+
expect(container.textContent).toContain('UTC Date: 2026-06-01');
40+
});
41+
});

0 commit comments

Comments
 (0)