-
-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ece8243
commit e8d5b29
Showing
7 changed files
with
57 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,14 @@ | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] | ||
pub enum SupportedClientFeatures { | ||
// Supports Collab Params serialization using Bincode | ||
CollabParamsBincode, | ||
// Supports Collab Params serialization using Protobuf | ||
CollabParamsProtobuf, | ||
} | ||
|
||
#[derive(Clone, Debug, Serialize, Deserialize)] | ||
pub struct ServerInfoResponseItem { | ||
pub version: String, | ||
pub supported_client_features: Vec<SupportedClientFeatures>, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
use client_api_test::generate_unique_registered_user_client; | ||
use shared_entity::dto::server_info_dto::SupportedClientFeatures; | ||
|
||
#[tokio::test] | ||
async fn test_get_server_info() { | ||
let (c, _) = generate_unique_registered_user_client().await; | ||
let resp = c | ||
.get_server_info() | ||
.await | ||
.expect("Failed to get server info"); | ||
let expected_features = vec![SupportedClientFeatures::CollabParamsBincode]; | ||
assert_eq!( | ||
resp.supported_client_features.len(), | ||
expected_features.len() | ||
); | ||
for i in 0..resp.supported_client_features.len() { | ||
assert_eq!(resp.supported_client_features[i], expected_features[i]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
mod info; |