mirror of
https://github.com/immich-app/immich.git
synced 2025-07-19 22:44:24 +02:00
test(mobile): store (#16243)
Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
parent
5acf6868b7
commit
94c0e8253a
7 changed files with 399 additions and 14 deletions
mobile/test
|
@ -21,10 +21,11 @@ import 'mock_http_override.dart';
|
|||
|
||||
// Listener Mock to test when a provider notifies its listeners
|
||||
class ListenerMock<T> extends Mock {
|
||||
// ignore: avoid-declaring-call-method
|
||||
void call(T? previous, T next);
|
||||
}
|
||||
|
||||
final class TestUtils {
|
||||
abstract final class TestUtils {
|
||||
const TestUtils._();
|
||||
|
||||
/// Downloads Isar binaries (if required) and initializes a new Isar db
|
||||
|
@ -50,13 +51,14 @@ final class TestUtils {
|
|||
AndroidDeviceAssetSchema,
|
||||
IOSDeviceAssetSchema,
|
||||
],
|
||||
maxSizeMiB: 1024,
|
||||
directory: "test/",
|
||||
maxSizeMiB: 1024,
|
||||
inspector: false,
|
||||
);
|
||||
|
||||
// Clear and close db on test end
|
||||
addTearDown(() async {
|
||||
await db.writeTxn(() => db.clear());
|
||||
await db.writeTxn(() async => await db.clear());
|
||||
await db.close();
|
||||
});
|
||||
return db;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue