Skip to content

Conversation

@sysid
Copy link
Owner

@sysid sysid commented Oct 19, 2025

Summary

  • Implement comprehensive test infrastructure using real Anki collection data
  • Add golden dataset with 15 diverse notes covering various content types
  • Create test fixture system with automatic dataset refresh capability
  • Expand test coverage from basic unit tests to full integration tests

Changes

Test Infrastructure

  • Added TestCollection helper for managing temporary test collections
  • Implemented fixture copying system to isolate test data
  • Created shell script to refresh fixtures from golden dataset
  • Added test note ID constants for consistent test references

Test Coverage

  • AnkiRepository tests: Note retrieval, deletion, media directory access (8 tests)
  • HtmlPresenter tests: Media path resolution, HTML processing, multi-image handling (5 tests)
  • NoteDeleter tests: Note and card deletion, error handling (3 tests)
  • NoteViewer tests: End-to-end note viewing with rendering (4 tests)

Test Data

  • Golden dataset in data/testuser/ with 15 real Anki notes
  • Test fixture in ankiview/tests/fixtures/test_collection/
  • 4 media files (PNG images) for testing image path resolution
  • Diverse content: data structures, algorithms, data science metrics, geographic concepts

Developer Experience

  • New Makefile targets: refresh-test-fixture, test-verbose
  • Media cleanup script for maintaining test data consistency
  • Comprehensive fixture documentation in README files

@sysid sysid merged commit e2d4246 into main Oct 19, 2025
1 check passed
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.

2 participants