use super::*;
#[test]
fn test_field_alias_ac() -> common::TestResult {
let (temp_dir, date) = init_project_with_date()?;
let output = run_commands(
temp_dir.path(),
&[
&["work", "new", "Test Task"],
&[
"work",
"add",
&format!("WI-{}-001", date),
"ac",
"add: Test criterion",
],
&["work", "get", &format!("WI-{}-001", date), "ac"],
],
)?;
assert_edit_snapshot!(normalize_output(&output, temp_dir.path(), &date)?);
Ok(())
}
#[test]
fn test_field_alias_desc() -> common::TestResult {
let (temp_dir, date) = init_project_with_date()?;
let output = run_commands(
temp_dir.path(),
&[
&["work", "new", "Test Task"],
&[
"work",
"set",
&format!("WI-{}-001", date),
"desc",
"A description",
],
&["work", "get", &format!("WI-{}-001", date), "desc"],
],
)?;
assert_edit_snapshot!(normalize_output(&output, temp_dir.path(), &date)?);
Ok(())
}
#[test]
fn test_field_alias_desc_under_legacy_prefix() -> common::TestResult {
let (temp_dir, date) = init_project_with_date()?;
let output = run_commands(
temp_dir.path(),
&[
&["work", "new", "Test Task"],
&[
"work",
"set",
&format!("WI-{}-001", date),
"content.desc",
"Legacy-prefixed description",
],
&["work", "get", &format!("WI-{}-001", date), "description"],
],
)?;
assert_edit_snapshot!(normalize_output(&output, temp_dir.path(), &date)?);
Ok(())
}
#[test]
fn test_field_alias_desc_not_global_on_adr() -> common::TestResult {
let (temp_dir, date) = init_project_with_date()?;
let output = run_commands(
temp_dir.path(),
&[
&["adr", "new", "Alias Scope"],
&["adr", "set", "ADR-0001", "desc", "nope"],
],
)?;
assert_edit_snapshot!(normalize_output(&output, temp_dir.path(), &date)?);
Ok(())
}