diff --git a/test/encryption/encrypt_decrypt_room_message_test.dart b/test/encryption/encrypt_decrypt_room_message_test.dart index f2a46dad..72271342 100644 --- a/test/encryption/encrypt_decrypt_room_message_test.dart +++ b/test/encryption/encrypt_decrypt_room_message_test.dart @@ -91,5 +91,9 @@ void main() { expect(decryptedEvent.content['msgtype'], 'm.text'); expect(decryptedEvent.content['text'], 'Hello foxies!'); }); + + test('dispose client', () async { + await client.dispose(closeDatabase: true); + }); }); } diff --git a/test/encryption/encrypt_decrypt_to_device_test.dart b/test/encryption/encrypt_decrypt_to_device_test.dart index 7a35d6f3..0be0a195 100644 --- a/test/encryption/encrypt_decrypt_to_device_test.dart +++ b/test/encryption/encrypt_decrypt_to_device_test.dart @@ -111,5 +111,10 @@ void main() { expect(decryptedEvent.type, 'm.to_device'); expect(decryptedEvent.content['hello'], 'superfoxies'); }); + + test('dispose client', () async { + await client.dispose(closeDatabase: true); + await otherClient.dispose(closeDatabase: true); + }); }); } diff --git a/test/encryption/key_manager_test.dart b/test/encryption/key_manager_test.dart index 7f29edd3..aba2c34d 100644 --- a/test/encryption/key_manager_test.dart +++ b/test/encryption/key_manager_test.dart @@ -215,5 +215,9 @@ void main() { null, true); }); + + test('dispose client', () async { + await client.dispose(closeDatabase: true); + }); }); } diff --git a/test/encryption/key_verification_test.dart b/test/encryption/key_verification_test.dart index 48825f03..1a9ddc94 100644 --- a/test/encryption/key_verification_test.dart +++ b/test/encryption/key_verification_test.dart @@ -99,5 +99,9 @@ void main() { expect(verified, true); keyVerification?.dispose(); }); + + test('dispose client', () async { + await client.dispose(closeDatabase: true); + }); }); } diff --git a/test/encryption/olm_manager_test.dart b/test/encryption/olm_manager_test.dart index 65c10d1b..047d0ecf 100644 --- a/test/encryption/olm_manager_test.dart +++ b/test/encryption/olm_manager_test.dart @@ -108,5 +108,9 @@ void main() { .containsKey(client.identityKey), true); }); + + test('dispose client', () async { + await client.dispose(closeDatabase: true); + }); }); } diff --git a/test/room_test.dart b/test/room_test.dart index 69000d6d..0703e154 100644 --- a/test/room_test.dart +++ b/test/room_test.dart @@ -330,13 +330,13 @@ void main() { final dynamic resp = await room.sendEvent( {'msgtype': 'm.text', 'body': 'hello world'}, txid: 'testtxid'); - expect(resp, '\$event0'); + expect(resp.startsWith('\$event'), true); }); test('sendEvent', () async { final dynamic resp = await room.sendTextEvent('Hello world', txid: 'testtxid'); - expect(resp, '\$event1'); + expect(resp.startsWith('\$event'), true); }); // Not working because there is no real file to test it... diff --git a/test/timeline_test.dart b/test/timeline_test.dart index caf13099..9044a671 100644 --- a/test/timeline_test.dart +++ b/test/timeline_test.dart @@ -143,7 +143,8 @@ void main() { expect(updateCount, 5); expect(insertList, [0, 0, 0]); expect(insertList.length, timeline.events.length); - expect(timeline.events[0].eventId, '\$event0'); + final eventId = timeline.events[0].eventId; + expect(eventId.startsWith('\$event'), true); expect(timeline.events[0].status, 1); client.onEvent.add(EventUpdate( @@ -155,7 +156,7 @@ void main() { 'content': {'msgtype': 'm.text', 'body': 'test'}, 'sender': '@alice:example.com', 'status': 2, - 'event_id': '\$event0', + 'event_id': eventId, 'unsigned': {'transaction_id': '1234'}, 'origin_server_ts': DateTime.now().millisecondsSinceEpoch }, @@ -166,7 +167,7 @@ void main() { expect(updateCount, 6); expect(insertList, [0, 0, 0]); expect(insertList.length, timeline.events.length); - expect(timeline.events[0].eventId, '\$event0'); + expect(timeline.events[0].eventId, eventId); expect(timeline.events[0].status, 2); });