chore: rename trait

This commit is contained in:
appflowy
2022-03-15 11:07:18 +08:00
parent 46be04f94e
commit 50f32521c5
59 changed files with 1444 additions and 852 deletions

View File

@ -26,11 +26,11 @@ pub struct ViewTest {
impl ViewTest {
#[allow(dead_code)]
pub async fn new(sdk: &FlowySDKTest, data_type: ViewDataType) -> Self {
pub async fn new(sdk: &FlowySDKTest, data_type: ViewDataType, data: String) -> Self {
let workspace = create_workspace(sdk, "Workspace", "").await;
open_workspace(sdk, &workspace.id).await;
let app = create_app(sdk, "App", "AppFlowy GitHub Project", &workspace.id).await;
let view = create_view(sdk, &app.id, data_type).await;
let view = create_view(sdk, &app.id, data_type, data).await;
Self {
sdk: sdk.clone(),
workspace,
@ -39,14 +39,12 @@ impl ViewTest {
}
}
#[allow(dead_code)]
pub async fn new_grid_view(sdk: &FlowySDKTest) -> Self {
Self::new(sdk, ViewDataType::Grid).await
pub async fn new_grid_view(sdk: &FlowySDKTest, data: String) -> Self {
Self::new(sdk, ViewDataType::Grid, data).await
}
#[allow(dead_code)]
pub async fn new_text_block_view(sdk: &FlowySDKTest) -> Self {
Self::new(sdk, ViewDataType::TextBlock).await
Self::new(sdk, ViewDataType::TextBlock, "".to_owned()).await
}
}
@ -93,15 +91,15 @@ async fn create_app(sdk: &FlowySDKTest, name: &str, desc: &str, workspace_id: &s
app
}
async fn create_view(sdk: &FlowySDKTest, app_id: &str, data_type: ViewDataType) -> View {
async fn create_view(sdk: &FlowySDKTest, app_id: &str, data_type: ViewDataType, data: String) -> View {
let request = CreateViewPayload {
belong_to_id: app_id.to_string(),
name: "View A".to_string(),
desc: "".to_string(),
thumbnail: Some("http://1.png".to_string()),
data_type,
ext_data: "".to_string(),
plugin_type: 0,
data,
};
let view = FolderEventBuilder::new(sdk.clone())