Files
crawlapi/crates/api/tests/integration_test.rs
Developer 62994d4f3d
Some checks failed
CI / Test (push) Has been cancelled
Deploy / Deploy to Staging (push) Has been cancelled
CI / Build & Push (push) Has been cancelled
Deploy / Deploy to Production (push) Has been cancelled
Initial commit: Full Crawl API implementation
2026-04-29 07:03:48 +00:00

30 lines
865 B
Rust

use serde_json::json;
#[tokio::test]
async fn test_health_check() {
// This is a placeholder for integration tests
// In a real setup, you would spawn the API server and make HTTP requests
assert!(true);
}
#[tokio::test]
async fn test_crawl_request_validation() {
let req = shared::models::CrawlRequest {
url: "https://example.com".to_string(),
options: shared::models::CrawlOptions::default(),
};
assert_eq!(req.url, "https://example.com");
}
#[tokio::test]
async fn test_api_response_format() {
let response = shared::api::ApiResponse::ok(json!({"test": true}));
assert!(response.success);
assert!(response.data.is_some());
assert!(response.error.is_none());
let error = shared::api::ApiResponse::<()>::err("Something went wrong");
assert!(!error.success);
assert!(error.error.is_some());
}