Merge pull request #570 from GetStream/fix-persistence-flaky-test
test(persistence): fix flaky channel query test
This commit is contained in:
@@ -1,5 +1,3 @@
|
|||||||
import 'dart:math' as math;
|
|
||||||
|
|
||||||
import 'package:stream_chat/stream_chat.dart';
|
import 'package:stream_chat/stream_chat.dart';
|
||||||
import 'package:stream_chat_persistence/src/dao/channel_query_dao.dart';
|
import 'package:stream_chat_persistence/src/dao/channel_query_dao.dart';
|
||||||
import 'package:stream_chat_persistence/src/db/moor_chat_database.dart';
|
import 'package:stream_chat_persistence/src/db/moor_chat_database.dart';
|
||||||
@@ -84,9 +82,9 @@ void main() {
|
|||||||
cid: cids[index],
|
cid: cids[index],
|
||||||
createdBy: users[index],
|
createdBy: users[index],
|
||||||
config: ChannelConfig(),
|
config: ChannelConfig(),
|
||||||
extraData: {'test_custom_field': math.Random().nextInt(100)},
|
extraData: {'test_custom_field': 3 + index},
|
||||||
createdAt: now,
|
createdAt: now,
|
||||||
memberCount: math.Random().nextInt(100),
|
memberCount: 3 + index,
|
||||||
lastMessageAt: now.add(Duration(hours: index)),
|
lastMessageAt: now.add(Duration(hours: index)),
|
||||||
),
|
),
|
||||||
).reversed.toList(growable: false);
|
).reversed.toList(growable: false);
|
||||||
@@ -99,6 +97,8 @@ void main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group('getChannels', () {
|
group('getChannels', () {
|
||||||
|
tearDown(() async => database.flush());
|
||||||
|
|
||||||
final filter = Filter.in_('members', const ['testUserId']);
|
final filter = Filter.in_('members', const ['testUserId']);
|
||||||
|
|
||||||
test('should return empty list of channels', () async {
|
test('should return empty list of channels', () async {
|
||||||
|
|||||||
Reference in New Issue
Block a user