Skip to content

feat: comprehensive testing infrastructure#4

Open
sbafsk wants to merge 15 commits intomainfrom
feature/testing-infrastructure
Open

feat: comprehensive testing infrastructure#4
sbafsk wants to merge 15 commits intomainfrom
feature/testing-infrastructure

Conversation

@sbafsk
Copy link
Collaborator

@sbafsk sbafsk commented Sep 9, 2025

Summary

  • Adds comprehensive testing infrastructure with MSW, Jest, and test utilities
  • Includes component tests, API tests, integration tests, and performance tests
  • Enhances Jest configuration with better coverage thresholds and mock support
  • Updates documentation and setup scripts

Test plan

  • Jest configuration supports all test types
  • MSW mock server works for API testing
  • Component tests render and test UI behavior
  • Integration tests cover user workflows
  • API route tests validate GraphQL endpoints

Changes Made

Testing Infrastructure

  • MSW mock server configuration for API mocking
  • Enhanced Jest config with polyfills and module mapping
  • Test setup with proper environment configuration

Test Coverage

  • Component tests for UI elements (PropertyCard, InputField, etc.)
  • Hook tests for data fetching and state management
  • Integration tests for tour booking workflow
  • API route tests for GraphQL and auth endpoints
  • Performance monitoring tests

Development Tools

  • Storybook scripts for component development
  • Enhanced coverage thresholds (80%)
  • Better test utilities and mocks

This establishes a solid foundation for test-driven development with comprehensive coverage across all application layers.

🤖 Generated with Claude Code

sbafsk and others added 15 commits September 5, 2025 01:15
- Add Redis client configuration with connection handling
- Implement CacheManager with TTL and key management utilities
- Create CachedPropertyRepository extending base repository pattern
- Add cache invalidation strategies for data consistency
- Include graceful fallback when Redis is unavailable
- Support for hierarchical cache keys and statistics
- Implement query complexity analysis with 1000 point limit
- Add complexity estimators for different field types
- Include rate limiting based on complexity per user
- Provide DoS protection against expensive queries
- Add complexity monitoring and logging utilities
- Support for custom complexity scoring rules
- Add CacheStats and PerformanceStats types to schema
- Implement cached GraphQL resolvers with Redis integration
- Add new queries: searchProperties, agencyProperties, cacheStats, performanceStats
- Update resolver index to use cached query resolvers
- Include admin-only access controls for monitoring endpoints
- Support for real-time performance and cache statistics
- Add query complexity validation rules to Apollo Server
- Include enhanced error handling for complexity violations
- Update server configuration with performance optimizations
- Add support for complexity-based error messages
- Prepare server for production performance monitoring
- Add ioredis and graphql-query-complexity dependencies
- Include comprehensive test suite for performance enhancements
- Add tests for cache manager, performance monitor, and complexity analysis
- Cover Redis operations, monitoring decorators, and error scenarios
- Ensure 100% test coverage for new performance features
- Update yarn.lock with new dependency resolutions
- Complete comprehensive documentation for all performance features
- Add implementation summary with production readiness checklist
- Update MCP configuration files with formatting improvements
- Ensure all documentation follows project standards
- Add dotenv package to handle .env.local file loading
- Update yarn.lock with new dependency
- Required for production seed script to access environment variables
- Add data/production-seed.sql with curated luxury properties from ML data
- Add data/real-properties-ml.json with scraped MercadoLibre property data
- Add lib/seed/production-seed.ts with TypeScript seed loader class
- Includes 4 premium agencies, 6 luxury properties (04K-6.7M), and sample contact requests
- Enhanced for Dubai investors with luxury amenities and descriptions
- Uses proper database enum values (AVAILABLE, NEW) and service role authentication
- Add scripts/seed-production.ts with comprehensive CLI interface
- Supports --clean flag to clean existing data before loading
- Supports --help flag for usage information
- Uses dotenv to load environment variables from .env.local
- Uses SUPABASE_SERVICE_ROLE_KEY for proper database access
- Includes connection testing and detailed progress reporting
- Handles errors gracefully with proper exit codes
- Update docs/guides/github-mcp-config.md with latest configuration details
- Update scripts/setup-github-mcp.sh with improved setup process
- Enhance documentation for MCP server integration
- Improve setup script reliability and error handling
- Add http2.mlstatic.com to remotePatterns in next.config.js
- Allows Next.js Image component to load property images from MercadoLibre
- Fixes 'hostname not configured' error for production seed data images
- Add proper type assertions for request.json() calls in mock handlers
- Fix property spread order issue in GraphQL createProperty mock
- Add TypeScript suppression comments for polyfill assignments
- Add whatwg-fetch polyfill for Request/Response in tests
- Import polyfills in test setup

These changes resolve all TypeScript compilation errors in the test suite
while maintaining compatibility with existing test functionality.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add polyfills setup for test environment compatibility
- Add MSW module mapping for proper mock server imports
- Increase coverage thresholds to 80% for better test quality
- Add MSW and whatwg-fetch dependencies for mock server functionality
- Add Storybook scripts for component development

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Update GitHub MCP configuration documentation
- Improve setup script for GitHub MCP integration
- Provide better guidance for development environment setup

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add MSW mock server configuration for API testing
- Add component tests for UI elements (PropertyCard, InputField, etc)
- Add hook tests for data fetching logic
- Add integration tests for tour booking workflow
- Add API route tests for GraphQL endpoints
- Add performance monitoring tests
- Add test utilities and mocks for consistent testing
- Set up proper test environment with polyfills and setup

This establishes a solid foundation for test-driven development
with proper mocking, component testing, and integration testing.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Sep 9, 2025

Deployment failed with the following error:

Environment Variable "NEXT_PUBLIC_SUPABASE_URL" references Secret "next_public_supabase_url", which does not exist.

Learn More: https://vercel.com/docs/environment-variables

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments