use super::*;
#[test]
fn a_follow_answered_once_is_the_tail_the_transcript_folds() {
let mut row = agent("c-1", AgentState::InFlight, 100);
row.stream = crate::git_tree::Stream {
text: Some("half a thought".to_owned()),
thinking: None,
last_delta: Some(crate::git_tree::Delta::Text),
};
let d = deps(snapshot(&ws(), "alba", vec![row.clone()], vec![]));
let asked = Query::Follow {
workspace: "alba".to_owned(),
agent: "c-1".to_owned(),
};
let Ok(Reply::Follow(stream)) = answer(&asked, &d, &ui(), 0) else {
panic!("a follow answers a fold");
};
assert_eq!(stream, row.stream, "the snapshot's own tail, unmoved");
let settled = deps(snapshot(
&ws(),
"alba",
vec![agent("c-1", AgentState::Quiescent, 100)],
vec![],
));
let Ok(Reply::Follow(nothing)) = answer(&asked, &settled, &ui(), 0) else {
panic!("a follow answers a fold");
};
assert_eq!(nothing, crate::git_tree::Stream::default());
}