Skip to content

test(components): add timezone normalization and calendar boundary tests for SuccessGuide#7808

Open
ashishraj1504 wants to merge 2 commits into
JhaSourav07:mainfrom
ashishraj1504:fix/success-guide-timezone-boundaries
Open

test(components): add timezone normalization and calendar boundary tests for SuccessGuide#7808
ashishraj1504 wants to merge 2 commits into
JhaSourav07:mainfrom
ashishraj1504:fix/success-guide-timezone-boundaries

Conversation

@ashishraj1504

Copy link
Copy Markdown
Contributor

Description

Fixes #6845
Program: GSSoC 2026

This PR introduces an isolated timezone boundary integration test suite at app/components/SuccessGuide.timezone-boundaries.test.tsx verifying calendar date normalization, leap year rendering, and daylight savings time adjustments within SuccessGuide.tsx.

Changes Made

  • Created the test file app/components/SuccessGuide.timezone-boundaries.test.tsx with 5 dedicated scenarios targeting dynamic timezone environments (UTC, EST, IST, JST).
  • Validated layout formatting consistency across leap year days and DST calculation transitions.
  • Maintained complete strict type coverage matching the native properties interface structure of the component.

Why this matters

Ensures the documentation calendar frames handle varied global browser offsets seamlessly, preventing regional layout drops or calculation anomalies for international developers viewing instruction metrics.

Pillar

  • 🎨 Pillar 1 — New Theme Design
  • 📐 Pillar 2 — Geometric SVG Improvement
  • 🕐 Pillar 3 — Timezone Logic Optimization
  • 🛠️ Other (Bug fix, refactoring, docs)

Checklist before requesting a review:

  • I have read the CONTRIBUTING.md file.
  • I have tested these changes locally (npm run test).
  • I have run npm run format and npm run lint locally and resolved all errors (CI will fail otherwise).
  • My commits follow the Conventional Commits format (e.g., feat(themes): ..., fix(calculate): ...).
  • I have updated README.md if I added a new theme or URL parameter.
  • I have starred the repo.
  • I have made sure that i have only one commit to merge in this PR.
  • The SVG output matches the CommitPulse "premium quality" aesthetic standard (no raw elements, smooth animations, correct fonts).
  • (Recommended) I joined the CommitPulse Discord server for faster collaboration, mentorship, and PR support.

Copilot AI review requested due to automatic review settings July 8, 2026 16:12
@vercel

vercel Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

@ashishraj1504 is attempting to deploy a commit to the jhasourav07's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Vitest + React Testing Library test suite intended to validate timezone boundary and calendar-date edge cases for the SuccessGuide component.

Changes:

  • Introduces SuccessGuide.timezone-boundaries.test.tsx with 5 “timezone/leap year/DST/locale format” scenarios.
  • Adds module mocks for framer-motion and ./Icons to keep tests renderable in the test environment.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +32 to +52
it('Case 1: Mock standard global timezone configurations (e.g., America/New_York, Asia/Kolkata, Asia/Tokyo) and verify calculations accurately bind localized metadata onto intended layout timelines', () => {
const timezones = ['America/New_York', 'Asia/Kolkata', 'Asia/Tokyo'];
const markdown = '![badge](https://example.com/badge.svg)';
const onDismiss = vi.fn();

timezones.forEach((tz) => {
mockSystemTimezoneAndDate(tz, '2026-07-04T12:00:00Z');

const currentDate = new Date();
expect(currentDate.toISOString()).toBe('2026-07-04T12:00:00.000Z');

const { unmount } = render(<SuccessGuide markdown={markdown} onDismiss={onDismiss} />);

expect(screen.getByText('Your Monolith is Ready - Deploy It in 4 Steps')).toBeInTheDocument();
expect(screen.getByText('Open Your Profile Repo')).toBeInTheDocument();

const snippet = screen.getByLabelText('Your badge markdown snippet');
expect(snippet.textContent).toBe(markdown);

unmount();
});
Comment on lines +1 to +4
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
import { render, screen, fireEvent } from '@testing-library/react';
import type { ReactNode } from 'react';
import { SuccessGuide } from './SuccessGuide';
Comment on lines +16 to +30
const mockSystemTimezoneAndDate = (timezone: string, dateIsoString: string) => {
vi.stubEnv('TZ', timezone);
vi.useFakeTimers();
vi.setSystemTime(new Date(dateIsoString));
};

describe('SuccessGuide Timezone Normalization & Calendar Data Boundary Alignment', () => {
beforeEach(() => {
vi.restoreAllMocks();
});

afterEach(() => {
vi.useRealTimers();
vi.unstubAllEnvs();
});
@github-actions github-actions Bot added the status:blocked This PR is blocked due to a failing CI check. label Jul 8, 2026
@ashishraj1504 ashishraj1504 force-pushed the fix/success-guide-timezone-boundaries branch from cac295a to 534f137 Compare July 8, 2026 16:53
@ashishraj1504 ashishraj1504 requested a review from Copilot July 8, 2026 16:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.

Comment on lines +25 to +29
describe('SuccessGuide Timezone Normalization & Calendar Data Boundary Alignment', () => {
beforeEach(() => {
vi.restoreAllMocks();
});

Comment on lines +85 to +92
mockSystemTimezoneAndDate('America/New_York', '2024-03-10T01:59:59-05:00');

const beforeTransition = new Date();
expect(beforeTransition.getHours()).toBe(1);

const afterTransition = new Date(beforeTransition.getTime() + 1000);
expect(afterTransition.getHours()).toBe(3);

Comment on lines +119 to +120
expect(usFormatted).toBe('7/4/2026');
expect(gbFormatted).toBe('04/07/2026');
@github-actions github-actions Bot removed the status:blocked This PR is blocked due to a failing CI check. label Jul 9, 2026
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

📦 Next.js Bundle Size Report (Gzipped Sizes)

✨ No significant bundle size changes detected.

📊 Summary of Totals

Category PR Size Base Size Difference
Total JS 3917.41 KB 3917.41 KB 0 B
Total CSS 325.86 KB 325.86 KB 0 B

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(SuccessGuide-timezone-boundaries): verify Timezone Normalization & Calendar Data Boundary Alignment (Variation 8)

2 participants