add more user and channel config test

This commit is contained in:
Salvatore Giordano
2021-06-17 10:01:46 +02:00
parent aef63f3722
commit 91907639ad
4 changed files with 25 additions and 24 deletions
@@ -4,7 +4,7 @@ import 'package:stream_chat/src/core/models/command.dart';
part 'channel_config.g.dart';
/// The class that contains the information about the configuration of a channel
@JsonSerializable()
@JsonSerializable(createToJson: false)
class ChannelConfig {
/// Constructor used for json serialization
ChannelConfig({
@@ -87,7 +87,4 @@ class ChannelConfig {
/// True if urls appears as attachments
@JsonKey(defaultValue: false)
final bool urlEnrichment;
/// Serialize to json
Map<String, dynamic> toJson() => _$ChannelConfigToJson(this);
}
@@ -32,22 +32,3 @@ ChannelConfig _$ChannelConfigFromJson(Map<String, dynamic> json) {
urlEnrichment: json['url_enrichment'] as bool? ?? false,
);
}
Map<String, dynamic> _$ChannelConfigToJson(ChannelConfig instance) =>
<String, dynamic>{
'automod': instance.automod,
'commands': instance.commands.map((e) => e.toJson()).toList(),
'connect_events': instance.connectEvents,
'created_at': instance.createdAt.toIso8601String(),
'updated_at': instance.updatedAt.toIso8601String(),
'max_message_length': instance.maxMessageLength,
'message_retention': instance.messageRetention,
'mutes': instance.mutes,
'reactions': instance.reactions,
'read_events': instance.readEvents,
'replies': instance.replies,
'search': instance.search,
'typing_events': instance.typingEvents,
'uploads': instance.uploads,
'url_enrichment': instance.urlEnrichment,
};