Accessibility Checker Tests
This directory contains comprehensive tests for the Accessibility Checker backend API, organized by functionality categories.
π Test Categories
/forms-and-flashing/
Tests for form detection and flashing objects analysis:
test-forms-flashing-separation.js- Tests separation of forms and flashing objects into distinct checkstest-form-duplicate-prevention.js- Tests deduplication of form field detectionstest-improved-form-detection.js- Tests enhanced form detection patternstest-forms-flashing.js- Legacy combined forms and flashing test
/location-tracking/
Tests for location-aware accessibility detection:
test-location-tracking.js- Tests paragraph-level location tracking systemtest-image-locations.js- Tests image accessibility with location informationtest-gif-location-detection.js- Tests GIF detection with relationship mapping and locations
/link-analysis/
Tests for link accessibility analysis:
test-link-descriptiveness.js- Tests detection of non-descriptive link texttest-duplicate-links.js- Tests deduplication of link issues
/system-fixes/
Tests for system-level fixes and improvements:
test-flagging-system.js- Tests conversion from auto-fix to flagging systemtest-function-fix.js- Tests fix for function definition scope issues
/legacy/
Historical tests from earlier development phases:
test-advanced-shadows.js- Advanced shadow removal teststest-batch-processing.js- Batch document processing teststest-comprehensive-shadows.js- Comprehensive shadow detection teststest-line-spacing-detection.js- Line spacing analysis teststest-line-spacing.js- Line spacing validation teststest-session-system.js- Session management teststest-shadow-removal.js- Shadow removal functionality teststest-simple-detection.js- Basic detection tests
π Running Tests
Run All Tests
# Run all tests in a category
node tests/forms-and-flashing/test-forms-flashing-separation.js
node tests/location-tracking/test-gif-location-detection.js
node tests/link-analysis/test-duplicate-links.js
node tests/system-fixes/test-function-fix.js
Run Category Tests
# Forms and Flashing
find tests/forms-and-flashing -name "*.js" -exec node {} \;
# Location Tracking
find tests/location-tracking -name "*.js" -exec node {} \;
# Link Analysis
find tests/link-analysis -name "*.js" -exec node {} \;
# System Fixes
find tests/system-fixes -name "*.js" -exec node {} \;
π Test Coverage
Current Functionality Coverage:
- β Forms Detection - Enhanced patterns, duplicate prevention, location tracking
- β Flashing Objects - Separate analysis, animation detection, location tracking
- β GIF Detection - Location mapping, relationship parsing, accessibility recommendations
- β Link Analysis - Non-descriptive detection, pattern matching, deduplication
- β Location Tracking - Paragraph-level precision, page estimation, context tracking
- β System Integrity - Function scoping, error handling, flagging system
Key Features Tested:
- Separation of Concerns - Forms and flashing objects as distinct checks
- Duplicate Prevention - Location-based deduplication using Set()
- Priority Selection - Smart form type prioritization when multiple patterns match
- Comprehensive Detection - 14+ form element types, 9+ animation types
- Location Precision - Paragraph numbers, page estimates, heading context
- Error Handling - Function definition fixes, scope resolution
π― Development Workflow
These tests were created during active development to validate:
- API Response Structure - Ensuring proper JSON formatting and field consistency
- Location Information - Verifying paragraph-level tracking across all checks
- Deduplication Logic - Preventing multiple reports of the same accessibility issue
- Pattern Matching - Validating regex patterns for various document structures
- Function Integration - Testing function availability and proper scoping
- Feature Separation - Ensuring modular, maintainable code architecture
π Success Metrics
Tests validate these success criteria:
- No Duplicate Reports - Each accessibility issue reported exactly once
- Accurate Locations - Precise paragraph and page information for all issues
- Comprehensive Coverage - Detection of all supported accessibility issues
- Error-Free Execution - No function definition or runtime errors
- Consistent Formatting - Uniform API response structure across all checks
Last Updated: November 12, 2025
Total Tests: 20+ comprehensive test files
Coverage: Forms, Flashing Objects, GIFs, Links, Locations, System Fixes