fix coverage

This commit is contained in:
Sorunome 2020-06-05 11:32:02 +02:00
parent 8358dec3a5
commit f065a92445
No known key found for this signature in database
GPG key ID: B19471D07FC9BE9C
7 changed files with 27 additions and 5 deletions

View file

@ -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);
});
});
}

View file

@ -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);
});
});
}

View file

@ -215,5 +215,9 @@ void main() {
null,
true);
});
test('dispose client', () async {
await client.dispose(closeDatabase: true);
});
});
}

View file

@ -99,5 +99,9 @@ void main() {
expect(verified, true);
keyVerification?.dispose();
});
test('dispose client', () async {
await client.dispose(closeDatabase: true);
});
});
}

View file

@ -108,5 +108,9 @@ void main() {
.containsKey(client.identityKey),
true);
});
test('dispose client', () async {
await client.dispose(closeDatabase: true);
});
});
}

View file

@ -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...

View file

@ -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);
});