Skip to content

Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.

[rust]:putback the app from trash

appflowy3387301554a4
diff --git a/rust-lib/flowy-workspace/tests/workspace/app_test.rs b/rust-lib/flowy-workspace/tests/workspace/app_test.rs
index c5d67c57d4..cfa4b82088 100644
--- a/rust-lib/flowy-workspace/tests/workspace/app_test.rs
+++ b/rust-lib/flowy-workspace/tests/workspace/app_test.rs
@@ -1,5 +1,9 @@
use flowy_test::workspace::*;
-use flowy_workspace::entities::{app::QueryAppRequest, view::*};
+use flowy_workspace::entities::{
+ app::QueryAppRequest,
+ trash::{TrashIdentifier, TrashType},
+ view::*,
+};
#[tokio::test]
#[should_panic]
@@ -12,6 +16,26 @@ async fn app_delete() {
let _ = read_app(&test.sdk, query).await;
}
+#[tokio::test]
+async fn app_delete_then_putback() {
+ let test = AppTest::new().await;
+ delete_app(&test.sdk, &test.app.id).await;
+ putback_trash(
+ &test.sdk,
+ TrashIdentifier {
+ id: test.app.id.clone(),
+ ty: TrashType::App,
+ },
+ )
+ .await;
+
+ let query = QueryAppRequest {
+ app_ids: vec![test.app.id.clone()],
+ };
+ let app = read_app(&test.sdk, query).await;
+ assert_eq!(&app, &test.app);
+}
+
#[tokio::test]
async fn app_read() {
let test = AppTest::new().await;