From ccb5406ccfe139d5cc8017469e526f17b71ffb3c Mon Sep 17 00:00:00 2001 From: cschen Date: Sun, 3 Nov 2024 17:20:30 +0100 Subject: [PATCH] test: attaching to workspaces and making them active --- src/tests/client.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/tests/client.rs b/src/tests/client.rs index 56a7680..14c57f9 100644 --- a/src/tests/client.rs +++ b/src/tests/client.rs @@ -47,6 +47,26 @@ async fn test_cant_create_same_workspace_more_than_once() { }) .await } + +#[tokio::test] +async fn test_workspace_attach_and_active_workspaces() { + ClientFixture::of("alice") + .with(|client| { + let client = client.clone(); + + async move { + let workspace_name = uuid::Uuid::new_v4().to_string(); + + client.create_workspace(&workspace_name).await?; + let ws = client.attach_workspace(&workspace_name).await?; + + assert_or_err!(ws.id() == workspace_name); + assert_or_err!(client.active_workspaces().contains(&workspace_name)); + Ok(()) + } + }) + .await +} Ok(()) } })