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:
Krille-chan 2025-06-16 11:22:29 +02:00 committed by GitHub
commit ab8202d7bc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 3 deletions

View File

@ -1576,9 +1576,6 @@ class Client extends MatrixApi {
final success = await database.importDump(export);
if (success) {
// closing including DB
await dispose();
try {
bearerToken = null;

View File

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