swarm-controller: check the reserved matrix account is not deleted
`the_agents_own_matrix_account_cannot_be_deleted` checked only the 400. It now runs against a store that holds `main` and asserts nothing was deleted. `revoke` is off so that, if the reserved check ever stopped refusing, the handler would delete the stored account and fail the test rather than call a homeserver.
This commit is contained in:
parent
1ff4ced0e1
commit
35f509d717
1 changed files with 4 additions and 2 deletions
|
|
@ -984,10 +984,11 @@ pub(crate) mod tests {
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Refused before the store, and before any revoke.
|
/// Refused before the store: `main` is stored, and stays.
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn the_agents_own_matrix_account_cannot_be_deleted() {
|
async fn the_agents_own_matrix_account_cannot_be_deleted() {
|
||||||
let problem = delete_matrix(&Arc::default(), "main", true)
|
let store = Arc::new(every_kind());
|
||||||
|
let problem = delete_matrix(&store, "main", false)
|
||||||
.await
|
.await
|
||||||
.expect_err("'main' is reserved");
|
.expect_err("'main' is reserved");
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
|
|
@ -995,6 +996,7 @@ pub(crate) mod tests {
|
||||||
Some(axum::http::StatusCode::BAD_REQUEST),
|
Some(axum::http::StatusCode::BAD_REQUEST),
|
||||||
"{problem:?}"
|
"{problem:?}"
|
||||||
);
|
);
|
||||||
|
assert!(deleted(&store).is_empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The control: any other account name is deleted.
|
/// The control: any other account name is deleted.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue