Watch
0
0
Fork
You've already forked hyperhive
0

test the invite room check and the no-homeserver sweep, drop the last space wording

This commit is contained in:
damocles 2026-10-28 21:07:32 +01:00
commit ae9c3444bc

View file

@ -460,4 +460,27 @@ mod tests {
assert!(!message.contains("free-form-marker"), "{message}");
}
}
/// A room that is neither an id nor an alias is refused before any
/// request is made; with no default Space left, there is nothing to fall
/// back to.
#[tokio::test]
async fn invite_user_refuses_a_room_that_is_neither_an_id_nor_an_alias() {
let client = swarm_matrix_client::client().expect("client");
let err = invite_user(&client, "tok", "mara", "general", "example.org")
.await
.expect_err("a bare name is not a room");
assert!(
format!("{err:#}").contains("neither a room id nor an alias"),
"{err:#}"
);
}
/// The sweep touches nothing, and reports success, on a hive with no
/// homeserver configured (the test environment has none).
#[tokio::test]
async fn the_sweep_is_a_successful_no_op_without_a_homeserver() {
assert!(!is_present());
assert!(ensure_all().await);
}
}