mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-07-13 03:56:11 +00:00

* 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
34 lines
775 B
Rust
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(¤t_workspace.id, "my document".to_string(), vec![])
|
|
.await;
|
|
view.id
|
|
}
|
|
}
|
|
|
|
impl Deref for AFCloudDocumentTest {
|
|
type Target = AFCloudTest;
|
|
|
|
fn deref(&self) -> &Self::Target {
|
|
&self.inner
|
|
}
|
|
}
|