Skip to content

Commit 79db17f

Browse files
committed
test(stream_chat_persistence): add team field coverage to channel mapper and query dao tests
1 parent 95c0247 commit 79db17f

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

packages/stream_chat_persistence/test/src/dao/channel_query_dao_test.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ void main() {
8787
createdAt: now,
8888
memberCount: index + 3,
8989
lastMessageAt: now.add(Duration(hours: index)),
90+
team: 'testTeam$index',
9091
),
9192
).toList(growable: false);
9293

@@ -124,6 +125,7 @@ void main() {
124125
expect(updatedChannel.cid, insertedChannel.cid);
125126
expect(updatedChannel.memberCount, insertedChannel.memberCount);
126127
expect(updatedChannel.filterTags, insertedChannel.filterTags);
128+
expect(updatedChannel.team, insertedChannel.team);
127129

128130
// Should match createdAt date
129131
expect(

packages/stream_chat_persistence/test/src/mapper/channel_mapper_test.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ void main() {
2626
createdById: user.id,
2727
filterTags: ['tag1', 'tag2'],
2828
extraData: {'test_extra_data': 'testData'},
29+
team: 'testTeam',
2930
);
3031

3132
test('toChannelModel should map entity into ChannelModel', () {
@@ -45,6 +46,7 @@ void main() {
4546
expect(channelModel.createdBy!.id, entity.createdById);
4647
expect(channelModel.filterTags, entity.filterTags);
4748
expect(channelModel.extraData, entity.extraData);
49+
expect(channelModel.team, entity.team);
4850
});
4951

5052
test('toChannelState should map entity into ChannelState ', () {
@@ -109,6 +111,7 @@ void main() {
109111
createdBy: createdBy,
110112
filterTags: ['tag1', 'tag2'],
111113
extraData: {'test_extra_data': 'testData'},
114+
team: 'testTeam',
112115
);
113116

114117
final channelEntity = model.toEntity();
@@ -130,5 +133,6 @@ void main() {
130133
expect(channelEntity.filterTags, model.filterTags);
131134
expect(channelEntity.extraData, model.extraData);
132135
expect(channelEntity.createdById, model.createdBy!.id);
136+
expect(channelEntity.team, model.team);
133137
});
134138
}

0 commit comments

Comments
 (0)