juanatsap
cb9a8eb044
cleanup: establish test suite as single source of truth
...
CRITICAL CHANGES:
✅ Deleted ALL redundant test files (40+ files removed)
✅ Added mobile responsive test (7-mobile-responsive.test.mjs)
✅ Created comprehensive tests/README.md
✅ Updated TEST-SUMMARY.md with accountability
SINGLE SOURCE OF TRUTH ESTABLISHED:
tests/
├── mjs/ # 8 ACTIVE TESTS - THE SPECIFICATION
│ ├── 0-zoom.test.mjs
│ ├── 1-toggles.test.mjs
│ ├── 2-keyboard-shortcuts.test.mjs
│ ├── 3-hyperscript.test.mjs
│ ├── 4-htmx.test.mjs
│ ├── 5-language.test.mjs
│ ├── 6-modals.test.mjs
│ └── 7-mobile-responsive.test.mjs
├── archive/ # Historical reference only
├── screenshots/ # Visual verification
├── run-all.mjs # Master test runner
└── TEST-SUMMARY.md # Complete documentation
DELETED FILES (40+):
- check-styling.html
- compare-rendered.js
- comprehensive-features.spec.js
- handlers.test, middleware.test
- All test-*.js, test-*.mjs, test-*.html files
- SHORTCUTS-BUTTON-FIX-REPORT.md
- test-screenshots/, testdata/ directories
- verify-years-styling.sh
- visual-comparison.spec.js
NEW: 7-mobile-responsive.test.mjs
Tests mobile viewport rendering:
- Mobile viewport (375px) - no horizontal scroll
- Tablet viewport (768px) - proper layout
- Touch interactions (hamburger menu)
- Responsive breakpoints (320px - 1920px)
- Viewport meta tag presence
- Touch-friendly button sizes (≥44px)
- Text readability (≥14px font)
NEW: tests/README.md
Establishes accountability:
- Tests ARE the specification
- Tests ARE the requirements
- If test passes but feature fails → TEST IS WRONG
- If feature works but test fails → FEATURE IS WRONG
- Every bug MUST have test coverage
- No deployment if tests fail
Updated TEST-SUMMARY.md:
- Added "SINGLE SOURCE OF TRUTH" header
- Documented mobile responsive test
- Clarified accountability model
- Updated test count: 8 active, 60+ archived
- Status: Production specification
Master runner auto-discovers all numbered tests
Run: bun tests/run-all.mjs
2025-11-17 13:41:46 +00:00
juanatsap
cd450837a2
feat: complete systematic test suite (tests 3-6)
...
Added comprehensive tests for remaining core functionality:
✅ 3-hyperscript.test.mjs
- Parse error detection
- Function definition verification
- Keyboard event handler validation
- Def statement count (≤3 limit)
- Operator precedence checks
✅ 4-htmx.test.mjs
- HTMX library loaded
- Element presence (hx-get, hx-post, hx-swap, hx-target)
- Request/response cycle validation
- Loading indicators
✅ 5-language.test.mjs
- Language toggle controls
- Default language (English)
- Spanish via URL parameter (?lang=es)
- Toggle button functionality
- localStorage/cookie persistence
✅ 6-modals.test.mjs
- Modal elements (info, shortcuts, PDF)
- ? key opens shortcuts modal
- ESC key closes modals
- Accessibility attributes (role, aria-label, aria-modal)
Updated TEST-SUMMARY.md:
- Now 7 active tests (0-6)
- Complete core feature coverage
- Updated coverage gaps (removed completed items)
All tests follow established patterns:
- Playwright browser automation
- Real-time validation
- Clear pass/fail indicators
- Browser stays open for manual verification
- Auto-discovered by master runner
Master runner: bun tests/run-all.mjs
2025-11-17 13:28:04 +00:00
juanatsap
5c60d108d8
refactor: organize test suite - systematic numbered tests + archive
...
ORGANIZATION:
- Created systematic numbered test suite in tests/mjs/
- Archived 60+ legacy tests organized by category
- Established master test runner (run-all.mjs)
- Updated comprehensive documentation
NEW ACTIVE TESTS:
- 0-zoom.test.mjs - Zoom control functionality
- 1-toggles.test.mjs - Toggle testing with real-time verification
- 2-keyboard-shortcuts.test.mjs - L, I, V, ? keyboard shortcuts
ARCHIVE STRUCTURE:
tests/archive/
├── toggles/ - 5 toggle tests
├── zoom/ - 1 zoom test
├── hyperscript/ - 4 hyperscript validation tests
├── keyboard/ - 2 keyboard tests
├── integration/ - 3 comprehensive integration tests
└── misc/ - 5 miscellaneous tests and docs
TEST INFRASTRUCTURE:
- tests/run-all.mjs - Master test runner (auto-discovers numbered tests)
- tests/TEST-SUMMARY.md - Complete documentation
- tests/archive/README.md - Archive guide
- tests/mjs/README.md - Active test suite guide
BENEFITS:
- 85% test redundancy eliminated
- Clear execution order (0-9 numbered)
- Easy to run: bun tests/run-all.mjs
- All legacy tests preserved (nothing deleted)
- Systematic coverage tracking
COVERAGE:
✅ Zoom control
✅ All toggles (length, icons, theme)
✅ Toggle synchronization
✅ Keyboard shortcuts (L, I, V, ?)
✅ Input field safety
✅ localStorage persistence
✅ Real-time rendering verification
TODO (Planned):
- [ ] 3-hyperscript.test.mjs
- [ ] 4-htmx.test.mjs
- [ ] 5-language.test.mjs
- [ ] 6-modals.test.mjs
2025-11-17 13:18:39 +00:00
juanatsap
3f77fedeaf
fix: icon toggle real-time rendering + hyperscript architecture cleanup
...
CRITICAL FIX: Icon toggle now works without page refresh
- Changed class name from 'show-logos' to 'show-icons' (CSS mismatch bug)
- Updated localStorage key from 'cv-logos' to 'cv-icons'
- Fixed toggleIcons() function in cv-functions.js
HYPERSCRIPT ARCHITECTURE:
- Moved 6 toggle functions from hyperscript to JavaScript (cv-functions.js)
- Solves hyperscript 0.9.14 parser limitation (max 3 def statements total)
- Upgraded hyperscript from 0.9.12 to 0.9.14
- Fixed operator precedence in keyboard shortcuts
- Cleaned view-controls.html templates (inline → function calls)
NEW FILES:
- static/js/cv-functions.js - Global toggle functions (6 functions)
- HYPERSCRIPT-RULES.md - Permanent architecture documentation
- tests/mjs/0-zoom.test.mjs - Zoom functionality test
- tests/mjs/1-toggles.test.mjs - Comprehensive toggle test with real-time verification
- tests/TEST-SUMMARY.md - Test suite documentation
TESTS:
- Real-time DOM update verification (no refresh required)
- Screenshot capture for visual regression
- localStorage persistence validation
- Toggle synchronization between action bar and menu
BREAKING CHANGE: localStorage key changed from 'cv-logos' to 'cv-icons'
Users may need to re-toggle icons preference on first load after update.
2025-11-17 13:00:03 +00:00