From b2171b5572a138595a5d06f7c8ea215aab797105 Mon Sep 17 00:00:00 2001 From: Sahil Kumar Date: Thu, 27 Jul 2023 02:29:57 +0530 Subject: [PATCH] test: fix test. Signed-off-by: xsahil03x --- packages/stream_chat/lib/src/core/models/attachment.g.dart | 5 +++-- packages/stream_chat/test/fixtures/message_to_json.json | 2 +- packages/stream_chat/test/src/core/models/message_test.dart | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/stream_chat/lib/src/core/models/attachment.g.dart b/packages/stream_chat/lib/src/core/models/attachment.g.dart index 38a8be16..51aae50e 100644 --- a/packages/stream_chat/lib/src/core/models/attachment.g.dart +++ b/packages/stream_chat/lib/src/core/models/attachment.g.dart @@ -26,8 +26,9 @@ Attachment _$AttachmentFromJson(Map json) => Attachment( authorIcon: json['author_icon'] as String?, assetUrl: json['asset_url'] as String?, actions: (json['actions'] as List?) - ?.map((e) => Action.fromJson(e as Map)) - .toList(), + ?.map((e) => Action.fromJson(e as Map)) + .toList() ?? + const [], originalWidth: json['original_width'] as int?, originalHeight: json['original_height'] as int?, extraData: json['extra_data'] as Map? ?? const {}, diff --git a/packages/stream_chat/test/fixtures/message_to_json.json b/packages/stream_chat/test/fixtures/message_to_json.json index 94aed066..7cb32216 100644 --- a/packages/stream_chat/test/fixtures/message_to_json.json +++ b/packages/stream_chat/test/fixtures/message_to_json.json @@ -5,7 +5,7 @@ "silent": false, "attachments": [ { - "type": "video", + "type": "giphy", "title_link": "https://media.giphy.com/media/5zvN79uTGfLMOVfQaA/giphy.gif", "title": "The Lion King Disney GIF - Find & Share on GIPHY", "thumb_url": "https://media.giphy.com/media/5zvN79uTGfLMOVfQaA/giphy.gif", diff --git a/packages/stream_chat/test/src/core/models/message_test.dart b/packages/stream_chat/test/src/core/models/message_test.dart index b5e6ddcc..c627a739 100644 --- a/packages/stream_chat/test/src/core/models/message_test.dart +++ b/packages/stream_chat/test/src/core/models/message_test.dart @@ -38,7 +38,7 @@ void main() { 'https://giphy.com/gifs/the-lion-king-live-action-5zvN79uTGfLMOVfQaA', attachments: [ Attachment.fromJson(const { - 'type': 'video', + 'type': 'giphy', 'author_name': 'GIPHY', 'title': 'The Lion King Disney GIF - Find \u0026 Share on GIPHY', 'title_link':