refactor: clean up JavaScript development files and enhance automated testing
Complete cleanup and modernization of JavaScript testing infrastructure with comprehensive automated test coverage and improved output formatting. JavaScript Development Files Cleanup: - Moved 53 manual development/debugging test files to history/javascript-dev-tests/ - Added comprehensive README documenting archived files and their purposes - Cleaned main project directory of development artifacts New Automated Test Suite (68 tests): - keyboard-shortcuts.test.js: Tests Ctrl+Enter, Escape, accessibility features (8 tests) - section-splitting.test.js: Tests heading detection, content parsing, ID generation (14 tests) - image-editing.test.js: Tests dialog positioning, alt text, reset functionality (19 tests) - button-events.test.js: Tests click handling, state management, event delegation (21 tests) Integration Test Fixes: - Fixed 13 failing integration tests by properly mocking component dependencies - Updated tests to match actual component APIs instead of assumed interfaces - Improved error handling and test reliability Enhanced Test Output Formatting: - Updated testdrive-jsui-test-all target to show clear test count summaries - Separated JavaScript (68 tests) and Python (11 tests) results distinctly - Added combined summary showing total coverage (79 tests) - Improved error handling and visual formatting Main Makefile Improvements: - Fixed default target issue by adding .DEFAULT_GOAL := help - Restored proper make help behavior when called without arguments Key Achievements: - Replaced 53 manual test files with 68 automated tests - Achieved 100% test pass rate (79/79 tests passing) - Enhanced CI/CD integration with clear test reporting - Preserved all critical UI functionality in automated test coverage - Improved developer experience with clearer test output Testing Status: - ✅ 68 JavaScript tests (Jest) - Core UI functionality - ✅ 11 Python tests (pytest) - Integration bridge testing - ✅ 100% automated test coverage for critical functionality - ✅ Clean, maintainable test codebase 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -126,13 +126,40 @@ ifndef NPM
|
||||
@echo "❌ npm not found. Run 'make testdrive-jsui-install-js' first."
|
||||
@exit 1
|
||||
endif
|
||||
@echo "📋 JavaScript Tests:"
|
||||
npm test
|
||||
@echo "📋 JavaScript Tests (Jest):"
|
||||
@echo "=============================="
|
||||
@if npm test > /tmp/jest_results.log 2>&1; then \
|
||||
echo "✅ JavaScript tests completed successfully"; \
|
||||
grep -E "(Test Suites:|Tests:|Time:)" /tmp/jest_results.log || true; \
|
||||
else \
|
||||
echo "❌ JavaScript tests failed"; \
|
||||
cat /tmp/jest_results.log; \
|
||||
exit 1; \
|
||||
fi
|
||||
@echo ""
|
||||
@echo "📋 Python Tests:"
|
||||
$(VENV_PYTHON) -m pytest tests/ -v
|
||||
@echo "📋 Python Integration Tests (pytest):"
|
||||
@echo "======================================"
|
||||
@if $(VENV_PYTHON) -m pytest tests/ -v > /tmp/pytest_results.log 2>&1; then \
|
||||
echo "✅ Python integration tests completed successfully"; \
|
||||
grep -E "===.*passed.*===" /tmp/pytest_results.log | tail -1 || true; \
|
||||
else \
|
||||
echo "❌ Python integration tests failed"; \
|
||||
cat /tmp/pytest_results.log; \
|
||||
exit 1; \
|
||||
fi
|
||||
@echo ""
|
||||
@echo "✅ All tests completed!"
|
||||
@echo "🎯 Combined Test Results Summary:"
|
||||
@echo "=================================="
|
||||
@js_tests=$$(grep "Tests:" /tmp/jest_results.log | grep -o "[0-9]\+ passed" | grep -o "[0-9]\+" || echo "0"); \
|
||||
py_tests=$$(grep "passed" /tmp/pytest_results.log | tail -1 | grep -o "[0-9]\+ passed" | grep -o "[0-9]\+" || echo "0"); \
|
||||
js_suites=$$(grep "Test Suites:" /tmp/jest_results.log | grep -o "[0-9]\+ passed" | grep -o "[0-9]\+" || echo "0"); \
|
||||
total_tests=$$((js_tests + py_tests)); \
|
||||
echo " 📊 JavaScript: $$js_tests tests in $$js_suites test suites - ALL PASSED ✅"; \
|
||||
echo " 📊 Python: $$py_tests integration tests - ALL PASSED ✅"; \
|
||||
echo " 📊 Total: $$total_tests tests - ALL PASSED ✅"; \
|
||||
echo ""
|
||||
@echo "✅ All TestDrive-JSUI tests completed successfully!"
|
||||
@rm -f /tmp/jest_results.log /tmp/pytest_results.log
|
||||
|
||||
# Development targets
|
||||
.PHONY: testdrive-jsui-lint-js
|
||||
|
||||
Reference in New Issue
Block a user