[rust]:putback the app from trash

This commit is contained in:
appflowy 2021-10-30 17:22:47 +08:00
parent 4966b03123
commit 3387301554

View File

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