Merge pull request #2107 from famedly/krille/add-tests-for-export-import
fix: exportDump and importDump and add unit tests
This commit is contained in:
commit
ab8202d7bc
|
|
@ -1576,9 +1576,6 @@ class Client extends MatrixApi {
|
||||||
final success = await database.importDump(export);
|
final success = await database.importDump(export);
|
||||||
|
|
||||||
if (success) {
|
if (success) {
|
||||||
// closing including DB
|
|
||||||
await dispose();
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
bearerToken = null;
|
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
|
/// All Tests related to the Login
|
||||||
group('client mem', tags: 'olm', () {
|
group('client mem', tags: 'olm', () {
|
||||||
late Client matrix;
|
late Client matrix;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue