Files
TimeTracker/pytest.ini
Dries Peeters 20b7401891 feat: Add invoice expenses, enhanced PDF editor with Konva.js, and uploads persistence
Major Features:
- Invoice Expenses: Allow linking billable expenses to invoices with automatic total calculations
  - Add expenses to invoices via "Generate from Time/Costs" workflow
  - Display expenses in invoice view, edit forms, and PDF exports
  - Track expense states (approved, invoiced, reimbursed) with automatic unlinking on invoice deletion
  - Update PDF generator and CSV exports to include expense line items

- Enhanced PDF Invoice Editor: Complete redesign using Konva.js for visual drag-and-drop layout design
  - Add 40+ draggable elements (company info, invoice data, shapes, text, advanced elements)
  - Implement comprehensive properties panel for precise element customization (position, fonts, colors, opacity)
  - Add canvas toolbar with alignment tools, zoom controls, and layer management
  - Support keyboard shortcuts (copy/paste, duplicate, arrow key positioning)
  - Save designs as JSON for editing and generate clean HTML/CSS for rendering
  - Add real-time preview with live data

- Uploads Persistence: Implement Docker volume persistence for user-uploaded files
  - Add app_uploads volume to all Docker Compose configurations
  - Ensure company logos and avatars persist across container rebuilds and restarts
  - Create migration script for existing installations
  - Update directory structure with proper permissions (755 for dirs, 644 for files)

Database & Backend:
- Add invoice_pdf_design_json column to settings table via Alembic migration
- Extend Invoice model with expenses relationship
- Update admin routes for PDF layout designer endpoints
- Enhance invoice routes to handle expense linking/unlinking

Frontend & UI:
- Redesign PDF layout editor template with Konva.js canvas (2484 lines, major overhaul)
- Update invoice edit/view templates to display and manage expenses
- Add expense sections to invoice forms with unlink functionality
- Enhance UI components with keyboard shortcuts support
- Update multiple templates for consistency and accessibility

Testing & Documentation:
- Add comprehensive test suites for invoice expenses, PDF layouts, and uploads persistence
- Create detailed documentation for all new features (5 new docs)
- Include migration guides and troubleshooting sections

Infrastructure:
- Update docker-compose files (main, example, remote, remote-dev, local-test) with uploads volume
- Configure pytest for new test modules
- Add template filters for currency formatting and expense display

This update significantly enhances TimeTracker's invoice management capabilities,
improves the PDF customization experience, and ensures uploaded files persist
reliably across deployments.
2025-10-29 15:03:01 +01:00

69 lines
1.6 KiB
INI

[pytest]
# Pytest configuration for TimeTracker
# Test discovery patterns
python_files = test_*.py
python_classes = Test*
python_functions = test_*
# Test paths
testpaths = tests
# Output options
addopts =
# Verbosity and output
-v
--tb=short
--strict-markers
--color=yes
# Warnings
-W ignore::DeprecationWarning
-W ignore::PendingDeprecationWarning
# Performance
--durations=10
# Note: Coverage fail-under should only be used when running ALL tests
# Do NOT use --cov-fail-under when running specific test markers (e.g., -m routes)
# Test markers for different test levels
markers =
smoke: Quick smoke tests (fastest, runs on every commit)
unit: Unit tests (fast, isolated tests)
integration: Integration tests (medium speed, tests component interaction)
api: API endpoint tests
database: Database-related tests
models: Model tests
routes: Route/endpoint tests
utils: Utility/helper function tests
security: Security-related tests
invoices: Invoice-related tests
admin: Admin panel and settings tests
performance: Performance and load tests
slow: Slow running tests
requires_db: Tests that require database connection
requires_network: Tests that require network access
skip_ci: Tests to skip in CI environment
# Coverage configuration
[coverage:run]
source = app
omit =
*/tests/*
*/test_*.py
*/__pycache__/*
*/venv/*
*/env/*
app/utils/pdf_generator.py
app/utils/pdf_generator_fallback.py
[coverage:report]
precision = 2
show_missing = True
skip_covered = False
[coverage:html]
directory = htmlcov