use serde_json::json;
use tinyhumans_sdk::TinyHumansClient;
use wiremock::matchers::{method, path};
use wiremock::{Mock, MockServer, ResponseTemplate};
#[tokio::test]
async fn check_unwraps_envelope() {
let server = MockServer::start().await;
Mock::given(method("GET"))
.and(path("/"))
.respond_with(
ResponseTemplate::new(200)
.set_body_json(json!({"success": true, "data": {"status": "ok"}})),
)
.mount(&server)
.await;
let client = TinyHumansClient::new(server.uri());
let result = client.health().check().await.unwrap();
assert_eq!(result, json!({"status": "ok"}));
}