Skip to content

Add Vitest + Testing Library test suite (31 tests, 5 files)#4

Open
paragon-review[bot] wants to merge 1 commit intomainfrom
add-test-suite
Open

Add Vitest + Testing Library test suite (31 tests, 5 files)#4
paragon-review[bot] wants to merge 1 commit intomainfrom
add-test-suite

Conversation

@paragon-review
Copy link
Copy Markdown
Contributor

Summary

Adds a comprehensive test suite for the React portfolio app using Vitest and Testing Library.

Changes

Test infrastructure

  • Installed vitest, @testing-library/react, @testing-library/jest-dom, @testing-library/user-event, jsdom
  • Added react-router-dom as explicit dependency (was imported but missing from package.json)
  • Created vitest.config.ts with jsdom environment and static asset mocking
  • Created src/test/setup.ts and src/test/mocks/fileMock.ts
  • Added test: vitest run script

Test files (31 tests total)

File Tests Coverage
App.test.tsx 6 Route rendering for all 4 routes, unknown routes, component validation
Home.test.tsx 5 Smoke render, heading, portfolio grid, footer, social links
Intouch.test.tsx 6 Smoke render, heading, skills list, back link, scroll-to-top, image error handler
PillThought.test.tsx 6 Smoke render, heading, section headings, back link, footer, scroll-to-top
Palkia.test.tsx 8 Smoke render, heading, sections, tech stack, back link, footer, video, scroll-to-top

Bug fix

  • Removed empty AboutProps interface in PillThought.tsx (was causing an ESLint error)

Verification

  • npx vitest run -- 31 passed, 0 failed
  • npm run build -- exits 0
  • npx eslint . -- 0 errors (9 pre-existing warnings)

Generated with Paragon

- Install vitest, @testing-library/react, @testing-library/jest-dom,
  @testing-library/user-event, jsdom as dev dependencies
- Add react-router-dom as explicit dependency (was imported but missing
  from package.json)
- Create vitest.config.ts with jsdom environment and asset mocking
- Create src/test/setup.ts with jest-dom matchers
- Create src/test/mocks/fileMock.ts for static asset imports
- Add "test": "vitest run" script to package.json

Test coverage:
- App.test.tsx (6): route rendering for /, /intouchcx, /pillthought,
  /palkia, unknown routes, component validation
- Home.test.tsx (5): smoke render, heading, portfolio grid, footer,
  social links
- Intouch.test.tsx (6): smoke render, heading, skills list, back link,
  scroll-to-top, image error handler
- PillThought.test.tsx (6): smoke render, heading, section headings,
  back link, footer, scroll-to-top
- Palkia.test.tsx (8): smoke render, heading, sections, tech stack,
  back link, footer, video element, scroll-to-top

Fix: Remove empty AboutProps interface in PillThought.tsx (lint error)

 Generated with Paragon
 Co-Authored-By: Paragon <support@polarity.cc>
@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 18, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
portfolio Ready Ready Preview, Comment Mar 18, 2026 0:31am
portfolio-dhgs Ready Ready Preview, Comment Mar 18, 2026 0:31am

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.

0 participants