Watch
0
0
Fork
You've already forked hyperhive
0

an archetype flow can be customized for one agent

This commit is contained in:
atlas 2026-11-11 21:40:51 +01:00 • committed by mara
commit 5443c1c9ba

View file

@ -1869,4 +1869,25 @@ mod tests {
// A stale key leaves the built-ins as they were.
assert_eq!(with(&[&flow]).active().0.len(), builtins().len());
}
/// What saving a customized archetype flow sends: a custom flow to one
/// agent and that agent's switch-off key, in one document.
#[test]
fn a_custom_flow_and_the_agents_switch_off_key_pass_the_check_together() {
let doc = Document {
disabled_builtins: vec![archetype_member_key("triage", "new-issues", "alice")],
flows: vec![sending_to(
"new-issues-alice",
Recipients::Agent("alice".to_owned()),
)],
..Document::default()
};
assert_eq!(doc.check(), Ok(()));
// The archetype's own `members` form is not what the copy carries.
let bad = Document {
flows: vec![sending_to("new-issues-alice", Recipients::Members)],
..doc
};
assert!(bad.check().is_err());
}
}