|
@@ -18,6 +18,7 @@ class TrashTestContext {
|
|
Future<void> initialize() async {
|
|
Future<void> initialize() async {
|
|
app = await unitTest.createTestApp();
|
|
app = await unitTest.createTestApp();
|
|
appBloc = AppBloc(app: app)..add(const AppEvent.initial());
|
|
appBloc = AppBloc(app: app)..add(const AppEvent.initial());
|
|
|
|
+ await blocResponseFuture();
|
|
|
|
|
|
appBloc.add(AppEvent.createView(
|
|
appBloc.add(AppEvent.createView(
|
|
"Document 1",
|
|
"Document 1",
|
|
@@ -40,7 +41,7 @@ class TrashTestContext {
|
|
await blocResponseFuture();
|
|
await blocResponseFuture();
|
|
|
|
|
|
allViews = [...appBloc.state.app.belongings.items];
|
|
allViews = [...appBloc.state.app.belongings.items];
|
|
- assert(allViews.length == 3);
|
|
|
|
|
|
+ assert(allViews.length == 3, 'but receive ${allViews.length}');
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -89,12 +90,14 @@ void main() {
|
|
// delete a view permanently
|
|
// delete a view permanently
|
|
trashBloc.add(TrashEvent.delete(trashBloc.state.objects[0]));
|
|
trashBloc.add(TrashEvent.delete(trashBloc.state.objects[0]));
|
|
await blocResponseFuture();
|
|
await blocResponseFuture();
|
|
- assert(trashBloc.state.objects.length == 2);
|
|
|
|
|
|
+ assert(trashBloc.state.objects.length == 2,
|
|
|
|
+ "but receive ${trashBloc.state.objects.length}");
|
|
|
|
|
|
// delete all view permanently
|
|
// delete all view permanently
|
|
trashBloc.add(const TrashEvent.deleteAll());
|
|
trashBloc.add(const TrashEvent.deleteAll());
|
|
await blocResponseFuture();
|
|
await blocResponseFuture();
|
|
- assert(trashBloc.state.objects.isEmpty);
|
|
|
|
|
|
+ assert(trashBloc.state.objects.isEmpty,
|
|
|
|
+ "but receive ${trashBloc.state.objects.length}");
|
|
});
|
|
});
|
|
});
|
|
});
|
|
}
|
|
}
|