Skip to content

Test/themes unit tests#2780

Closed
ANU5565 wants to merge 3 commits into
Priyanshu-byte-coder:mainfrom
ANU5565:test/themes-unit-tests
Closed

Test/themes unit tests#2780
ANU5565 wants to merge 3 commits into
Priyanshu-byte-coder:mainfrom
ANU5565:test/themes-unit-tests

Conversation

@ANU5565

@ANU5565 ANU5565 commented Jun 24, 2026

Copy link
Copy Markdown

Summary

This PR adds unit tests for src/lib/themes.ts to ensure theme validation and navigation logic function as expected. This closes #2758.

Closes #2758


Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that changes existing behavior)
  • 📝 Documentation update
  • ♻️ Refactor / code cleanup (no functional change)
  • ⚡ Performance improvement
  • 🔒 Security fix
  • 🧪 Tests only

What Changed

-Created test/themes.test.ts.

  • Added tests for isThemeId, getThemeDefinition, isDarkTheme, and nextThemeId covering valid/invalid inputs and edge cases.

Checklist

  • Linked the related issue above
  • Self-reviewed my own diff
  • No unnecessary console.log, debug code, or commented-out blocks
  • npm run lint passes locally
  • No TypeScript errors (npm run type-check)
  • Added or updated tests where applicable
  • Updated documentation / comments if behavior changed

Accessibility (UI changes only)

  • Keyboard navigation works correctly
  • Color contrast meets WCAG AA standard
  • ARIA labels / roles added where needed
  • Tested on mobile / responsive layout

Additional Context

@github-actions github-actions Bot added gssoc26 GSSoC 2026 contribution type:design GSSoC type bonus: UI/design (+10 pts) type:testing GSSoC type bonus: tests (+10 pts) labels Jun 24, 2026
@github-actions

Copy link
Copy Markdown

GSSoC Label Checklist 🏷️

@Umbrella-io — please apply the appropriate labels before merging:

Difficulty (pick one):

  • level:beginner — 20 pts
  • level:intermediate — 35 pts
  • level:advanced — 55 pts
  • level:critical — 80 pts

Quality (optional):

  • quality:clean — ×1.2 multiplier
  • quality:exceptional — ×1.5 multiplier

Validation (required to score):

  • gssoc:approved — counts for points
  • gssoc:invalid / gssoc:spam / gssoc:ai-slop — does not score

Type labels (type:*) are auto-detected from files and title. Review and adjust if needed.
Points formula: (difficulty × quality_multiplier) + type_bonus

@Priyanshu-byte-coder

Copy link
Copy Markdown
Owner

Closing. For themes: #2774 was selected (uses loops over making tests maintainable when themes are added). For rate-limit: #2733 was selected (comprehensive). This PR bundles both in one PR which complicates review, and both portions are outclassed by the selected PRs. Thanks for contributing!

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

Labels

gssoc26 GSSoC 2026 contribution type:design GSSoC type bonus: UI/design (+10 pts) type:testing GSSoC type bonus: tests (+10 pts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test : add unit tests for themes.ts

2 participants