summaryrefslogtreecommitdiff
path: root/player-android/test/models_test.dart
AgeCommit message (Collapse)Author
2026-05-20Add DioClient with auth interceptors and refactor PlayerApiClient (ma)Paul Buetow
Introduces dio_client.dart with _AuthInterceptor (guards Bearer token injection with containsKey so callers can override Authorization) and _UnauthorizedInterceptor (private fields, 401 → login redirect). PlayerApiClient is refactored to accept a pre-configured Dio instance instead of raw credentials; adds dio + flutter_secure_storage deps. Fixes review issues: Auth header comment/behavior corrected, private fields on _UnauthorizedInterceptor, unused import removed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20Fix PlayerApiClient const constructor and Media.tags deserialization (d9+e9)Paul Buetow
- Remove const from PlayerApiClient constructor (Uri is not const-constructable) - Replace .cast<String>() with .whereType<String>().toList() in Media.fromJson to silently drop non-string and null tag elements instead of throwing TypeError - Add regression test: tags [1, 'valid', null] deserialized as ['valid'] Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18Add Dart unit tests for models and API client constructorPaul Buetow
Add fromJson/toJson round-trip tests for all 9 Dart models (Media, MediaSet, User, Tag, Note, Share, PodcastFeed, PodcastEpisode, PlaybackHint) and 3 PlayerApiClient constructor tests. Each model group covers a fully-populated round-trip (including int-to-double cast verification and ISO-8601 DateTime value comparison) and an exhaustive defaults-from-empty-map test. All 21 tests run via 'flutter test' with no emulator. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>