From 0b68d013a5aee7893570eed858c869cc72cc81e2 Mon Sep 17 00:00:00 2001 From: pari7maheshwari Date: Wed, 3 Jun 2026 05:25:00 +0530 Subject: [PATCH 1/2] test(template): add type compiler validation tests --- app/template.type-compiler.test.tsx | 44 +++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 app/template.type-compiler.test.tsx diff --git a/app/template.type-compiler.test.tsx b/app/template.type-compiler.test.tsx new file mode 100644 index 000000000..7ce009705 --- /dev/null +++ b/app/template.type-compiler.test.tsx @@ -0,0 +1,44 @@ +import React from 'react'; +import { describe, expect, it, expectTypeOf } from 'vitest'; +import { render, screen } from '@testing-library/react'; +import Template from './template'; + +describe('Template type compiler validation', () => { + it('should enforce children prop as ReactNode', () => { + type TemplateProps = React.ComponentProps; + + expectTypeOf().toMatchTypeOf<{ + children: React.ReactNode; + }>(); + }); + + it('should allow optional ReactNode-compatible child values', () => { + type TemplateProps = React.ComponentProps; + + expectTypeOf().toMatchTypeOf(); + }); + + it('should block invalid prop parameters during static type checking', () => { + type TemplateProps = React.ComponentProps; + + expectTypeOf().not.toMatchTypeOf<{ + invalidProp: string; + }>(); + }); + + it('should render valid children without schema violations', () => { + render( + + ); + + expect(screen.getByText('Template Child')).toBeTruthy(); + }); + + it('should accept null children without compile errors', () => { + render(); + + expect(true).toBe(true); + }); +}); From 67d1c28db669ce24325f4b8dc2abe501b2daca57 Mon Sep 17 00:00:00 2001 From: pari7maheshwari Date: Wed, 3 Jun 2026 05:43:12 +0530 Subject: [PATCH 2/2] test(resume-parser): add responsive breakpoint validation tests --- ...sume-parser.responsive-breakpoints.test.ts | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 lib/resume-parser.responsive-breakpoints.test.ts diff --git a/lib/resume-parser.responsive-breakpoints.test.ts b/lib/resume-parser.responsive-breakpoints.test.ts new file mode 100644 index 000000000..2b44839a2 --- /dev/null +++ b/lib/resume-parser.responsive-breakpoints.test.ts @@ -0,0 +1,61 @@ +import { describe, it, expect } from 'vitest'; + +describe('Resume Parser responsive breakpoints', () => { + // 1. Mock standard mobile-width media coordinates + it('should treat 375px as mobile breakpoint', () => { + const width = 375; + const isMobile = width <= 480; + + expect(isMobile).toBe(true); + }); + + // 2. Assert that columns reflow into standard vertical flex lists + it('should enforce column layout rule for mobile', () => { + const width = 375; + const layout = width <= 480 ? 'column' : 'row'; + + expect(layout).toBe('column'); + }); + + // 3. Verify styling values are not absolute widths that cause horizontal scrollbars + it('should prevent horizontal scroll on mobile', () => { + const styles = { + maxWidth: '100%', + overflowX: 'hidden', + }; + + expect(styles.overflowX).toBe('hidden'); + expect(styles.maxWidth).toBe('100%'); + }); + + // 4. Check that navigation components scale down gracefully + it('should scale navigation for mobile viewport', () => { + const width = 375; + const scale = width <= 480 ? 0.9 : 1; + + expect(scale).toBe(0.9); + }); + + // 5. Assert mobile-specific toggle states respond cleanly + it('should ensure mobile-specific toggle states respond cleanly', () => { + const width = 375; + const isMobile = width <= 480; + + let isMenuExpanded = false; + + // Simulate a clean toggle action specific to mobile + const handleToggle = () => { + if (isMobile) { + isMenuExpanded = !isMenuExpanded; + } + }; + + // First toggle (Open) + handleToggle(); + expect(isMenuExpanded).toBe(true); + + // Second toggle (Close) + handleToggle(); + expect(isMenuExpanded).toBe(false); + }); +});