Watch
0
0
Fork
You've already forked hyperhive
0

hive-matrix-mcp: add a leave_room tool

This commit is contained in:
damocles 2026-11-22 19:01:51 +01:00 • committed by mara
commit d88a0cc526

View file

@ -247,6 +247,24 @@ async fn rejecting_an_invite_leaves_the_room() {
assert_eq!(got["room_id"], "!invited:localhost");
}
#[tokio::test]
async fn leaving_a_joined_room_asks_the_server_and_an_unknown_room_is_refused() {
let (server, client) = caught_up_room().await;
server
.mock_room_leave()
.ok(room_id!("!room:localhost"))
.expect(1)
.mount()
.await;
let got = ok(leave_room(&client, "!room:localhost").await);
assert_eq!(got["left"], true);
assert_eq!(got["room_id"], "!room:localhost");
let unknown = err(leave_room(&client, "!never:localhost").await);
assert!(unknown.contains("not joined"), "{unknown}");
}
#[tokio::test]
async fn reading_a_room_returns_its_events_newest_first_with_sender_and_body() {
let (_server, client) = room_with(vec![