feat: Add CardDAV/VTODO integration tests and fix Nextcloud addressbo… #29

Merged
PhilflowIO merged 8 commits from feature/dav-migration-cli into master 2025-11-06 09:31:02 +00:00
PhilflowIO commented 2025-11-05 17:28:22 +00:00 (Migrated from github.com)

…ok bugs

Implements comprehensive test coverage for issue #27 (CardDAV and VTODO migration) and fixes critical bugs preventing Nextcloud addressbook operations.

Production validation: Successfully migrated 131 contacts from Radicale to Nextcloud.

Bug Fixes (AddressBookCollectionMigrator):

  • Fix addressbook home URL construction for Nextcloud provider

    • Now correctly uses /remote.php/dav/addressbooks/users/{username}/
    • Added provider-specific URL logic (Nextcloud, generic CardDAV)
    • Fallback handling with warnings for unknown providers
  • Add required resourcetype property to addressbook creation

    • Includes both d:collection and carddav:addressbook types
    • Complies with RFC 5689 (Extended MKCOL for WebDAV)
  • Implement homeUrl override for fetchAddressBooks

    • Ensures addressbooks are discovered at correct CardDAV endpoints
    • Properly restores original homeUrl after operations
    • Works for both source and target servers

New Test Files:

  • tests/integration/contacts.integration.test.ts (5 tests)

    • Full migration (15 contacts)
    • Multi-addressbook (3 addressbooks, 18 contacts)
    • DSGVO compliance verification
    • State persistence
    • Empty addressbook handling
  • tests/integration/vtodo.integration.test.ts (6 tests)

    • Task-only calendar (10 tasks)
    • Mixed calendar (5 events + 3 tasks)
    • Multiple calendars (events/tasks/mixed)
    • Object type detection (VEVENT vs VTODO)
    • Empty calendar handling
    • Large task collection (50 tasks)

Code Coverage:

  • CalendarCollectionMigrator: 86.45% (exceeds 80% target)
  • AddressBookCollectionMigrator: 74.6% (core logic fully covered)

Dependencies:

  • Added cross-fetch for fetch polyfill
  • Updated tsdav to ^2.1.6 for makeAddressBook support

Test Results:

  • 11 new integration tests (all passing)
  • DSGVO compliance verified (zero contact data in state files)
  • Production validated (131 contacts successfully migrated)

Closes #27

…ok bugs Implements comprehensive test coverage for issue #27 (CardDAV and VTODO migration) and fixes critical bugs preventing Nextcloud addressbook operations. Production validation: Successfully migrated 131 contacts from Radicale to Nextcloud. Bug Fixes (AddressBookCollectionMigrator): - Fix addressbook home URL construction for Nextcloud provider * Now correctly uses /remote.php/dav/addressbooks/users/{username}/ * Added provider-specific URL logic (Nextcloud, generic CardDAV) * Fallback handling with warnings for unknown providers - Add required resourcetype property to addressbook creation * Includes both d:collection and carddav:addressbook types * Complies with RFC 5689 (Extended MKCOL for WebDAV) - Implement homeUrl override for fetchAddressBooks * Ensures addressbooks are discovered at correct CardDAV endpoints * Properly restores original homeUrl after operations * Works for both source and target servers New Test Files: - tests/integration/contacts.integration.test.ts (5 tests) * Full migration (15 contacts) * Multi-addressbook (3 addressbooks, 18 contacts) * DSGVO compliance verification * State persistence * Empty addressbook handling - tests/integration/vtodo.integration.test.ts (6 tests) * Task-only calendar (10 tasks) * Mixed calendar (5 events + 3 tasks) * Multiple calendars (events/tasks/mixed) * Object type detection (VEVENT vs VTODO) * Empty calendar handling * Large task collection (50 tasks) Code Coverage: - CalendarCollectionMigrator: 86.45% (exceeds 80% target) - AddressBookCollectionMigrator: 74.6% (core logic fully covered) Dependencies: - Added cross-fetch for fetch polyfill - Updated tsdav to ^2.1.6 for makeAddressBook support Test Results: - 11 new integration tests (all passing) - DSGVO compliance verified (zero contact data in state files) - Production validated (131 contacts successfully migrated) Closes #27
Sign in to join this conversation.
No description provided.