test the wake prompt and the Messaging permission after the tool removal
This commit is contained in:
parent
8154c5da02
commit
9457f49684
1 changed files with 45 additions and 0 deletions
|
|
@ -184,6 +184,26 @@ impl From<Permission> for &'static str {
|
|||
mod tests {
|
||||
use super::*;
|
||||
|
||||
/// Agents message each other over matrix, so no permission grants a
|
||||
/// hyperhive messaging tool any more. `Messaging` stays a valid stored
|
||||
/// value, and it grants nothing.
|
||||
#[test]
|
||||
fn messaging_is_an_accepted_value_that_grants_no_tool() {
|
||||
assert!(Permission::Messaging.tools().is_empty());
|
||||
assert_eq!(
|
||||
serde_json::from_str::<Permission>("\"messaging\"").expect("stored value decodes"),
|
||||
Permission::Messaging
|
||||
);
|
||||
for p in Permission::ALL {
|
||||
for tool in p.tools() {
|
||||
assert!(
|
||||
!["send", "recv", "ack_until"].contains(tool),
|
||||
"{p:?} still grants the removed tool {tool}"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// The `as_str` spelling of every variant. `ALL` is stable-ordered, so
|
||||
/// a variant added to the enum but not to `ALL` or `as_str` shows here.
|
||||
#[test]
|
||||
|
|
|
|||
Loading…
Reference in a new issue