story-kit: done 199_story_web_ui_submits_all_queued_items_at_once

This commit is contained in:
Dave
2026-02-26 12:16:07 +00:00
parent f5f2716a3a
commit 2dbfd42c6e
5 changed files with 258 additions and 17 deletions

View File

@@ -307,7 +307,7 @@ async fn run_shell_command(cmd: &str, cwd: &Path) -> Result<(), String> {
#[cfg(test)]
mod tests {
use super::*;
use crate::config::ComponentConfig;
use crate::config::{ComponentConfig, WatcherConfig};
use std::fs;
use tempfile::TempDir;
@@ -491,6 +491,7 @@ mod tests {
let config = ProjectConfig {
component: vec![],
agent: vec![],
watcher: WatcherConfig::default(),
};
// Should complete without panic
run_setup_commands(tmp.path(), &config).await;
@@ -507,6 +508,7 @@ mod tests {
teardown: vec![],
}],
agent: vec![],
watcher: WatcherConfig::default(),
};
// Should complete without panic
run_setup_commands(tmp.path(), &config).await;
@@ -523,6 +525,7 @@ mod tests {
teardown: vec![],
}],
agent: vec![],
watcher: WatcherConfig::default(),
};
// Setup command failures are non-fatal — should not panic or propagate
run_setup_commands(tmp.path(), &config).await;
@@ -539,6 +542,7 @@ mod tests {
teardown: vec!["exit 1".to_string()],
}],
agent: vec![],
watcher: WatcherConfig::default(),
};
// Teardown failures are best-effort — should not propagate
assert!(run_teardown_commands(tmp.path(), &config).await.is_ok());
@@ -554,6 +558,7 @@ mod tests {
let config = ProjectConfig {
component: vec![],
agent: vec![],
watcher: WatcherConfig::default(),
};
let info = create_worktree(&project_root, "42_fresh_test", &config, 3001)
.await
@@ -576,6 +581,7 @@ mod tests {
let config = ProjectConfig {
component: vec![],
agent: vec![],
watcher: WatcherConfig::default(),
};
// First creation
let _info1 = create_worktree(&project_root, "43_reuse_test", &config, 3001)
@@ -614,6 +620,7 @@ mod tests {
let config = ProjectConfig {
component: vec![],
agent: vec![],
watcher: WatcherConfig::default(),
};
let result = remove_worktree_by_story_id(tmp.path(), "99_nonexistent", &config).await;
@@ -635,6 +642,7 @@ mod tests {
let config = ProjectConfig {
component: vec![],
agent: vec![],
watcher: WatcherConfig::default(),
};
create_worktree(&project_root, "88_remove_by_id", &config, 3001)
.await
@@ -660,6 +668,7 @@ mod tests {
teardown: vec![],
}],
agent: vec![],
watcher: WatcherConfig::default(),
};
// Even though setup commands fail, create_worktree must succeed
// so the agent can start and fix the problem itself.
@@ -684,6 +693,7 @@ mod tests {
let empty_config = ProjectConfig {
component: vec![],
agent: vec![],
watcher: WatcherConfig::default(),
};
// First creation — no setup commands, should succeed
create_worktree(&project_root, "173_reuse_fail", &empty_config, 3001)
@@ -698,6 +708,7 @@ mod tests {
teardown: vec![],
}],
agent: vec![],
watcher: WatcherConfig::default(),
};
// Second call — worktree exists, setup commands fail, must still succeed
let result =
@@ -719,6 +730,7 @@ mod tests {
let config = ProjectConfig {
component: vec![],
agent: vec![],
watcher: WatcherConfig::default(),
};
let info = create_worktree(&project_root, "77_remove_async", &config, 3001)
.await