Fix 25 tests for work/ directory restructure (story 60)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Dave
2026-02-20 17:24:26 +00:00
parent e1e0d49759
commit e15fbffbb8
3 changed files with 124 additions and 124 deletions

View File

@@ -1531,7 +1531,7 @@ mod tests {
#[test]
fn tool_get_story_todos_returns_unchecked() {
let tmp = tempfile::tempdir().unwrap();
let current_dir = tmp.path().join(".story_kit").join("current");
let current_dir = tmp.path().join(".story_kit").join("work").join("2_current");
fs::create_dir_all(&current_dir).unwrap();
fs::write(
current_dir.join("1_test.md"),
@@ -1944,10 +1944,10 @@ mod tests {
)
.unwrap();
assert!(result.contains("bug-1-login_crash"));
assert!(result.contains("1_bug_login_crash"));
let bug_file = tmp
.path()
.join(".story_kit/bugs/bug-1-login_crash.md");
.join(".story_kit/work/1_upcoming/1_bug_login_crash.md");
assert!(bug_file.exists());
}
@@ -1963,15 +1963,15 @@ mod tests {
#[test]
fn tool_list_bugs_returns_open_bugs() {
let tmp = tempfile::tempdir().unwrap();
let bugs_dir = tmp.path().join(".story_kit/bugs");
std::fs::create_dir_all(&bugs_dir).unwrap();
let upcoming_dir = tmp.path().join(".story_kit/work/1_upcoming");
std::fs::create_dir_all(&upcoming_dir).unwrap();
std::fs::write(
bugs_dir.join("bug-1-crash.md"),
upcoming_dir.join("1_bug_crash.md"),
"# Bug 1: App Crash\n",
)
.unwrap();
std::fs::write(
bugs_dir.join("bug-2-typo.md"),
upcoming_dir.join("2_bug_typo.md"),
"# Bug 2: Typo in Header\n",
)
.unwrap();
@@ -1980,9 +1980,9 @@ mod tests {
let result = tool_list_bugs(&ctx).unwrap();
let parsed: Vec<Value> = serde_json::from_str(&result).unwrap();
assert_eq!(parsed.len(), 2);
assert_eq!(parsed[0]["bug_id"], "bug-1-crash");
assert_eq!(parsed[0]["bug_id"], "1_bug_crash");
assert_eq!(parsed[0]["name"], "App Crash");
assert_eq!(parsed[1]["bug_id"], "bug-2-typo");
assert_eq!(parsed[1]["bug_id"], "2_bug_typo");
assert_eq!(parsed[1]["name"], "Typo in Header");
}
@@ -1999,9 +1999,9 @@ mod tests {
fn tool_close_bug_moves_to_archive() {
let tmp = tempfile::tempdir().unwrap();
setup_git_repo_in(tmp.path());
let bugs_dir = tmp.path().join(".story_kit/bugs");
std::fs::create_dir_all(&bugs_dir).unwrap();
let bug_file = bugs_dir.join("bug-1-crash.md");
let upcoming_dir = tmp.path().join(".story_kit/work/1_upcoming");
std::fs::create_dir_all(&upcoming_dir).unwrap();
let bug_file = upcoming_dir.join("1_bug_crash.md");
std::fs::write(&bug_file, "# Bug 1: Crash\n").unwrap();
// Stage the file so it's tracked
std::process::Command::new("git")
@@ -2016,9 +2016,9 @@ mod tests {
.unwrap();
let ctx = test_ctx(tmp.path());
let result = tool_close_bug(&json!({"bug_id": "bug-1-crash"}), &ctx).unwrap();
assert!(result.contains("bug-1-crash"));
let result = tool_close_bug(&json!({"bug_id": "1_bug_crash"}), &ctx).unwrap();
assert!(result.contains("1_bug_crash"));
assert!(!bug_file.exists());
assert!(bugs_dir.join("archive/bug-1-crash.md").exists());
assert!(tmp.path().join(".story_kit/work/5_archived/1_bug_crash.md").exists());
}
}