fix: exportDump and importDump and add unit tests
This commit is contained in:
parent
7d66fde236
commit
92f5427e0a
|
|
@ -1576,9 +1576,6 @@ class Client extends MatrixApi {
|
|||
final success = await database.importDump(export);
|
||||
|
||||
if (success) {
|
||||
// closing including DB
|
||||
await dispose();
|
||||
|
||||
try {
|
||||
bearerToken = null;
|
||||
|
||||
|
|
|
|||
|
|
@ -63,6 +63,19 @@ void main() {
|
|||
});
|
||||
});
|
||||
|
||||
group('Export and Import', () {
|
||||
test('exportDump and importDump', () async {
|
||||
final client = await getClient();
|
||||
final userId = client.userID;
|
||||
final export = await client.exportDump();
|
||||
expect(export != null, true);
|
||||
expect(client.userID, null);
|
||||
final importClient = Client('Import', database: await getDatabase());
|
||||
await importClient.importDump(export!);
|
||||
expect(importClient.userID, userId);
|
||||
});
|
||||
});
|
||||
|
||||
/// All Tests related to the Login
|
||||
group('client mem', tags: 'olm', () {
|
||||
late Client matrix;
|
||||
|
|
|
|||
Loading…
Reference in New Issue