use rxferrix::testing::*;
use crate::tasks;
#[rxferrix::test]
async fn adds_and_completes_tasks(t: TestApp) -> rxferrix::Result<()> {
let id = t.mutation::<tasks::add>("Write a test".to_string()).await?;
t.mutation::<tasks::set_done>((id, true)).await?;
let all = t.query::<tasks::list>(()).await?;
assert_eq!((all[0].text.as_str(), all[0].done), ("Write a test", true));
Ok(())
}
#[rxferrix::test]
async fn a_task_needs_text(t: TestApp) {
t.mutation::<tasks::add>(" ".to_string()).await.assert_user_error("empty_text");
}