fix tests

This commit is contained in:
Sorunome 2020-07-14 11:46:37 +02:00
parent 4394196ba1
commit 8b3e2e6c86
No known key found for this signature in database
GPG Key ID: B19471D07FC9BE9C
1 changed files with 6 additions and 3 deletions

View File

@ -300,6 +300,9 @@ void main() {
}); });
test('getParticipants', () async { test('getParticipants', () async {
var userList = room.getParticipants();
expect(userList.length, 4);
// add new user
room.setState(Event( room.setState(Event(
senderId: '@alice:test.abc', senderId: '@alice:test.abc',
type: 'm.room.member', type: 'm.room.member',
@ -309,9 +312,9 @@ void main() {
originServerTs: DateTime.now(), originServerTs: DateTime.now(),
content: {'displayname': 'alice'}, content: {'displayname': 'alice'},
stateKey: '@alice:test.abc')); stateKey: '@alice:test.abc'));
final userList = room.getParticipants(); userList = room.getParticipants();
expect(userList.length, 4); expect(userList.length, 5);
expect(userList[3].displayName, 'alice'); expect(userList[4].displayName, 'alice');
}); });
test('addToDirectChat', () async { test('addToDirectChat', () async {