aboutsummaryrefslogtreecommitdiff
path: root/scripts/tests
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/tests')
-rw-r--r--scripts/tests/install-ai.bats27
1 files changed, 27 insertions, 0 deletions
diff --git a/scripts/tests/install-ai.bats b/scripts/tests/install-ai.bats
index d67a9c6..dca70ea 100644
--- a/scripts/tests/install-ai.bats
+++ b/scripts/tests/install-ai.bats
@@ -37,6 +37,33 @@ teardown() {
[ -f "$TEST_HOME/code/fresh/.ai/protocols.org" ]
[ -f "$TEST_HOME/code/fresh/.ai/notes.org" ]
grep -qFx ".ai/" "$TEST_HOME/code/fresh/.gitignore"
+ # Top-level inbox/ is created so the project is an inbox-send target.
+ [ -d "$TEST_HOME/code/fresh/inbox" ]
+ [ -f "$TEST_HOME/code/fresh/inbox/.gitkeep" ]
+}
+
+@test "install-ai: creates top-level inbox/ in --track mode too" {
+ mkdir -p "$TEST_HOME/code/inbox-track"
+ (cd "$TEST_HOME/code/inbox-track" && git init -q)
+
+ run bash "$INSTALL_AI" --track "$TEST_HOME/code/inbox-track"
+
+ [ "$status" -eq 0 ]
+ [ -d "$TEST_HOME/code/inbox-track/inbox" ]
+ [ -f "$TEST_HOME/code/inbox-track/inbox/.gitkeep" ]
+}
+
+@test "install-ai: preserves a pre-existing inbox/ with content" {
+ mkdir -p "$TEST_HOME/code/has-inbox/inbox"
+ (cd "$TEST_HOME/code/has-inbox" && git init -q)
+ echo "handoff" > "$TEST_HOME/code/has-inbox/inbox/2026-06-01-existing.org"
+
+ run bash "$INSTALL_AI" --gitignore "$TEST_HOME/code/has-inbox"
+
+ [ "$status" -eq 0 ]
+ [ -d "$TEST_HOME/code/has-inbox/inbox" ]
+ # Existing inbox content is untouched.
+ [ -f "$TEST_HOME/code/has-inbox/inbox/2026-06-01-existing.org" ]
}
@test "install-ai --track: lands .gitkeep stubs in empty dirs" {