Skip to content

Commit

Permalink
fix: fix more test
Browse files Browse the repository at this point in the history
  • Loading branch information
xsahil03x committed Feb 28, 2025
1 parent 764b16a commit 3a0102a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions packages/stream_chat/lib/src/core/models/message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ class Message extends Equatable {
final String? _pollId;

/// The list of those users who have restricted visibility for this message.
@JsonKey(includeToJson: false)
final List<String>? restrictedVisibility;

/// Message custom extraData.
Expand Down
1 change: 0 additions & 1 deletion packages/stream_chat/lib/src/core/models/message.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions packages/stream_chat/test/fixtures/channel_state.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

{
"channel": {
"id": "dev",
Expand Down Expand Up @@ -79,7 +78,10 @@
"pinned_at": null,
"pin_expires": null,
"pinned_by": null,
"poll_id": null
"poll_id": null,
"restricted_visibility": [
"user-id-3"
]
},
{
"id": "dry-meadow-0-e8e74482-b4cd-48db-9d1e-30e6c191786f",
Expand Down
3 changes: 0 additions & 3 deletions packages/stream_chat/test/fixtures/message_to_json.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,5 @@
"pin_expires": null,
"poll_id": null,
"show_in_channel": true,
"restricted_visibility": [
"user-id-3"
],
"hey": "test"
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ void main() {
DateTime.parse('2020-01-29T03:23:02.843948Z'),
);
expect(channelState.messages![0].user, isA<User>());
expect(
channelState.messages![0].restrictedVisibility,
isA<List<String>>(),
);
expect(channelState.watcherCount, 5);
});

Expand All @@ -59,8 +63,6 @@ void main() {
watchers: [],
);

print(jsonEncode(channelState.messages?.first));

expect(
channelState.toJson(),
jsonFixture('channel_state_to_json.json'),
Expand Down

0 comments on commit 3a0102a

Please sign in to comment.