Skip to content

Commit 5f4e9f8

Browse files
Restore sync rate-limit composition coverage (#7431)
Mock the device-limit RPC with the authenticated actor so the API composition test can verify independent device and credential rate limits.
1 parent 33d262b commit 5f4e9f8

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

apps/api/src/tests.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use serde_json::{Value, json};
88
use tower::ServiceExt;
99
use wiremock::{
1010
Mock, MockServer, ResponseTemplate,
11-
matchers::{method, path},
11+
matchers::{body_json, method, path},
1212
};
1313

1414
use super::*;
@@ -609,6 +609,14 @@ async fn sync_composition_keeps_devices_and_sharing_available_when_credentials_a
609609
.mount(&server)
610610
.await;
611611

612+
Mock::given(method("POST"))
613+
.and(path("/rest/v1/rpc/get_sync_device_limit"))
614+
.and(body_json(json!({ "p_actor_user_id": "editor-user" })))
615+
.respond_with(ResponseTemplate::new(200).set_body_json(json!(3)))
616+
.expect(1)
617+
.mount(&server)
618+
.await;
619+
612620
let sync_state = test_sync_state(&server);
613621
let replica_state = test_replica_state(&server);
614622
for route in [

0 commit comments

Comments
 (0)