an archetype flow can be customized for one agent
This commit is contained in:
parent
f2e735a98f
commit
5443c1c9ba
1 changed files with 153 additions and 34 deletions
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue