use bevy_app::App;
use gamai::prelude::*;
use sweet::*;
#[sweet_test]
pub fn works() -> Result<()> {
let mut app = App::new();
app.add_plugins(ActionPlugin::<BuiltinNode, _>::default());
let target = app.world.spawn_empty().id();
let action_graph = ActionTree::new(vec![Box::new(SetRunResult::default())])
.into_action_graph();
let entity_graph = action_graph.spawn(&mut app.world, target);
let root = *entity_graph.root().unwrap();
expect(&app).to_have_component::<Running>(root)?;
app.update();
expect(&app).not().to_have_component::<Running>(root)?;
expect(&app).to_have_component::<RunResult>(root)?;
app.update();
expect(&app).not().to_have_component::<Running>(root)?;
expect(&app).not().to_have_component::<RunResult>(root)?;
Ok(())
}