Files
cv-site/tests/mjs
juanatsap f3cce51fb3 feat: implement color theme switcher with dynamic button colors
Complete color theme system (light/dark/auto) with dynamic UI:

Features:
- Color theme switcher with auto/light/dark modes
- Dynamic button colors on hover (purple/yellow/blue per theme)
- localStorage persistence across sessions
- Proper button positioning (desktop and mobile)
- Mobile: 5-button layout with theme before info button

Fixes:
- CSP updated to allow jsDelivr CDN for iconify icons
- Button repositioning: Download PDF and Print Friendly at top
- Hover-only colors (not persistent)
- Mobile button order corrected

Files:
- static/css/color-theme.css - Theme system with CSS variables
- static/js/color-theme.js - Theme switching logic
- templates/partials/color-theme-switcher.html - Button component
- internal/middleware/security.go - CSP fix for jsDelivr
- tests/mjs/13-color-theme-switcher.test.mjs - Comprehensive test
- tests/TEST-SUMMARY.md - Updated test documentation
2025-11-18 15:49:30 +00:00
..

CV Project Test Suite

Organized test files for the CV application. All tests use Playwright for browser automation.

Test Files

0-zoom.test.mjs

Purpose: Test zoom control functionality

  • Verifies zoom control elements exist
  • Tests visibility toggle
  • Validates zoom slider interaction
  • Checks real-time zoom updates

Run: bun tests/mjs/0-zoom.test.mjs

1-toggles.test.mjs

Purpose: Comprehensive toggle testing with real-time visual verification

  • Tests all 3 toggles (Length, Icons, Theme)
  • Validates action bar toggles
  • Tests hamburger menu toggles
  • Verifies synchronization between action bar and menu
  • Checks localStorage persistence
  • Critical: Validates that toggles update DOM immediately (no refresh needed)
  • Takes screenshots for visual comparison

Run: bun tests/mjs/1-toggles.test.mjs

Running All Tests

# Run individual tests
bun tests/mjs/0-zoom.test.mjs
bun tests/mjs/1-toggles.test.mjs

# Run all tests sequentially
for test in tests/mjs/*.test.mjs; do
  echo "Running $test..."
  bun "$test"
  echo ""
done

Test Requirements

  • Server must be running on http://localhost:1999
  • Browser window will stay open after tests for manual verification
  • Press Ctrl+C to exit test

Test Output

All tests provide:

  • Clear pass/fail indicators
  • 📊 Summary of results
  • Detailed error messages
  • 🎉 Success confirmation

Screenshots

Toggle tests save screenshots to tests/screenshots/:

  • before-icon-toggle.png - Before clicking icon toggle
  • after-icon-toggle.png - After clicking icon toggle

Use these to visually verify rendering changes.