2021-07-29 09:27:59 +00:00
|
|
|
use crate::helper::*;
|
|
|
|
|
|
|
|
use flowy_workspace::entities::view::*;
|
|
|
|
|
|
|
|
#[test]
|
2021-08-30 14:44:17 +00:00
|
|
|
fn view_create() { let _ = create_view(); }
|
2021-07-29 09:27:59 +00:00
|
|
|
|
|
|
|
#[test]
|
2021-08-30 14:44:17 +00:00
|
|
|
fn view_set_trash_flag() {
|
2021-07-29 09:27:59 +00:00
|
|
|
let view_id = create_view_with_trash_flag();
|
|
|
|
let query = QueryViewRequest::new(&view_id).set_is_trash(true);
|
|
|
|
let _ = read_view(query);
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
#[should_panic]
|
2021-08-30 14:44:17 +00:00
|
|
|
fn view_set_trash_flag2() {
|
2021-07-29 09:27:59 +00:00
|
|
|
let view_id = create_view_with_trash_flag();
|
|
|
|
let query = QueryViewRequest::new(&view_id);
|
|
|
|
let _ = read_view(query);
|
|
|
|
}
|
|
|
|
|
2021-08-30 14:44:17 +00:00
|
|
|
fn create_view_with_trash_flag() -> String {
|
2021-07-29 09:27:59 +00:00
|
|
|
let view = create_view();
|
|
|
|
let request = UpdateViewRequest {
|
|
|
|
view_id: view.id.clone(),
|
|
|
|
name: None,
|
|
|
|
desc: None,
|
|
|
|
thumbnail: None,
|
|
|
|
is_trash: Some(true),
|
|
|
|
};
|
|
|
|
update_view(request);
|
|
|
|
|
|
|
|
view.id
|
|
|
|
}
|