ci: Test all databases in unit tests
This commit is contained in:
parent
26c1629e7e
commit
d8ec1601a3
|
|
@ -27,11 +27,19 @@ import 'package:matrix/matrix.dart';
|
|||
import 'fake_database.dart';
|
||||
|
||||
void main() {
|
||||
group('Matrix SDK Database Test', () {
|
||||
final databaseBuilders = {
|
||||
'Matrix SDK Database': getMatrixSdkDatabase,
|
||||
'Hive Database': getHiveDatabase,
|
||||
'Hive Collections Database': getHiveCollectionsDatabase,
|
||||
};
|
||||
|
||||
for (final databaseBuilder in databaseBuilders.entries) {
|
||||
group('Test ${databaseBuilder.key}', () {
|
||||
late DatabaseApi database;
|
||||
late int toDeviceQueueIndex;
|
||||
|
||||
test('Setup', () async {
|
||||
database = await getMatrixSdkDatabase(null);
|
||||
database = await databaseBuilder.value(null);
|
||||
});
|
||||
test('transaction', () async {
|
||||
var counter = 0;
|
||||
|
|
@ -162,7 +170,8 @@ void main() {
|
|||
|
||||
await database.storeAccountData('m.abc+de', '{"foo":"bar"}');
|
||||
final events2 = await database.getAccountData();
|
||||
expect(events2.values.any((element) => element.type == 'm.abc+de'), true);
|
||||
expect(
|
||||
events2.values.any((element) => element.type == 'm.abc+de'), true);
|
||||
});
|
||||
test('storeEventUpdate', () async {
|
||||
await database.storeEventUpdate(
|
||||
|
|
@ -486,6 +495,7 @@ void main() {
|
|||
expect(dump.isEmpty, true);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Future<bool> olmEnabled() async {
|
||||
|
|
|
|||
Loading…
Reference in New Issue