hive-matrix-mcp: add a leave_room tool
This commit is contained in:
parent
56ed2e07da
commit
d88a0cc526
1 changed files with 68 additions and 4 deletions
|
|
@ -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![
|
||||
|
|
|
|||
Loading…
Reference in a new issue