Skip to content

test : added unit tests for KonamiEasterEgg component - #5

Open
tmdeveloper007 wants to merge 2 commits into
mainfrom
#8420
Open

tmdeveloper007 wants to merge 2 commits into
mainfrom
#8420

Conversation

@tmdeveloper007

Copy link
Copy Markdown
Owner

Summary of What Has Been Done

Created components/KonamiEasterEgg.test.tsx with comprehensive unit tests covering:

  • No overlay renders before the secret code is entered
  • Overlay renders after entering the default "commit" secret code
  • Overlay shows the "You Found It!" heading, git commit message, and version footer
  • Overlay renders when matrix rain is disabled (charCount=0)
  • Overlay renders when confetti is disabled (confettiCount=0)
  • Custom secretCode prop works correctly (triggers on custom code)
  • Keypresses in INPUT and TEXTAREA elements are ignored (do not trigger the easter egg)
  • Keydown event listener is registered on mount and removed on unmount

Mocked framer-motion components (motion.div, AnimatePresence) to prevent animation library dependencies in tests.

Changes Made

  • New file: components/KonamiEasterEgg.test.tsx

Impact it Made

Adds first unit test coverage for the KonamiEasterEgg component, ensuring the secret code detection and overlay rendering work correctly.

Closes #8420.

Note: please assign this PR to the tmdeveloper007 account.

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.

1 participant