summaryrefslogtreecommitdiff
path: root/player-android/test
diff options
context:
space:
mode:
Diffstat (limited to 'player-android/test')
-rw-r--r--player-android/test/models_test.dart9
1 files changed, 9 insertions, 0 deletions
diff --git a/player-android/test/models_test.dart b/player-android/test/models_test.dart
index 22dc190..84fbf62 100644
--- a/player-android/test/models_test.dart
+++ b/player-android/test/models_test.dart
@@ -126,6 +126,15 @@ void main() {
expect(media.deletedAt, isNull);
expect(media.createdAt, isNull);
});
+
+ // Regression test for e9: non-string and null elements in the tags list
+ // must be silently dropped rather than causing a TypeError at runtime.
+ test('fromJson drops non-string and null tag elements', () {
+ final media = Media.fromJson({'tags': [1, 'valid', null]});
+
+ // Only 'valid' survives: the integer 1 and null are filtered out.
+ expect(media.tags, ['valid']);
+ });
});
// ---------------------------------------------------------------------------