Nathan.fooo 3e088d48ac
refactor: fav and workspace (#3837)
* refactor: workspace

* chore: update collab rev

* test: add data migration test

* fix: test

* fix: tauri build

* test: fix bloc test

* test: fix bloc test

* test: fix bloc test

* chore: restore magic codde
2023-11-01 11:45:35 +08:00

34 lines
775 B
Rust

use std::ops::Deref;
use crate::util::{generate_test_email, AFCloudTest};
pub struct AFCloudDocumentTest {
inner: AFCloudTest,
}
impl AFCloudDocumentTest {
pub async fn new() -> Option<Self> {
let inner = AFCloudTest::new().await?;
let email = generate_test_email();
let _ = inner.af_cloud_sign_in_with_email(&email).await.unwrap();
Some(Self { inner })
}
pub async fn create_document(&self) -> String {
let current_workspace = self.inner.get_current_workspace().await;
let view = self
.inner
.create_document(&current_workspace.id, "my document".to_string(), vec![])
.await;
view.id
}
}
impl Deref for AFCloudDocumentTest {
type Target = AFCloudTest;
fn deref(&self) -> &Self::Target {
&self.inner
}
}