diff options
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/tests/agent-text.bats (renamed from scripts/tests/agent-page.bats) | 26 | ||||
| -rw-r--r-- | scripts/tests/install-ai.bats | 2 |
2 files changed, 18 insertions, 10 deletions
diff --git a/scripts/tests/agent-page.bats b/scripts/tests/agent-text.bats index 7317ac7..e5d80fc 100644 --- a/scripts/tests/agent-page.bats +++ b/scripts/tests/agent-text.bats @@ -1,15 +1,16 @@ #!/usr/bin/env bats -# agent-page — the runtime-neutral phone pager. Pages Craig over Signal from -# any machine on the tailnet: sends directly wherever the pager account is -# registered locally (velox, or any linked device), and ssh-relays to velox -# from a machine that doesn't hold the account. These tests stub -# ssh/signal-cli on PATH to verify command construction without a network or -# a phone. The signal-cli stub answers `listAccounts` to control which branch -# the dispatch takes. +# agent-text — the runtime-neutral Signal phone messenger ("text me"). Reaches +# Craig over Signal from any machine on the tailnet: sends directly wherever the +# account is registered locally (velox, or any linked device), and ssh-relays to +# velox from a machine that doesn't hold the account. These tests stub +# ssh/signal-cli on PATH to verify command construction without a network or a +# phone. The signal-cli stub answers `listAccounts` to control which branch the +# dispatch takes. The final test covers the deprecated agent-page shim. setup() { REPO_ROOT="$(cd "$(dirname "$BATS_TEST_FILENAME")/../.." && pwd)" - PAGE="$REPO_ROOT/claude-templates/bin/agent-page" + PAGE="$REPO_ROOT/claude-templates/bin/agent-text" + SHIM="$REPO_ROOT/claude-templates/bin/agent-page" STUBS="$(mktemp -d)" LOG="$STUBS/calls.log" cat > "$STUBS/ssh" <<EOF @@ -17,7 +18,7 @@ setup() { echo "ssh \$*" >> "$LOG" exit 0 EOF - # HAS_ACCOUNT controls the listAccounts answer: "1" → the pager account is + # HAS_ACCOUNT controls the listAccounts answer: "1" → the account is # local (send direct), unset/"0" → not local (relay). cat > "$STUBS/signal-cli" <<EOF #!/bin/bash @@ -68,3 +69,10 @@ EOF [ "$status" -ne 0 ] [[ "$output" == *"notify"* ]] } + +@test "the deprecated agent-page shim delegates to agent-text" { + HAS_ACCOUNT=1 PATH="$STUBS:$PATH" run bash "$SHIM" via shim + [ "$status" -eq 0 ] + # Reaches the same direct-send path as agent-text. + grep -q "^signal-cli -a +15045173983 send " "$LOG" +} diff --git a/scripts/tests/install-ai.bats b/scripts/tests/install-ai.bats index 14f1152..1549184 100644 --- a/scripts/tests/install-ai.bats +++ b/scripts/tests/install-ai.bats @@ -176,7 +176,7 @@ EOF # --- claude-templates/bin/install-ai launcher -------------------------------- # # The launcher is the PATH-facing front door (make install symlinks it into -# ~/.local/bin/install-ai, same loop as `ai` and `agent-page`). It resolves its +# ~/.local/bin/install-ai, same loop as `ai` and `agent-text`). It resolves its # own real path through the symlink and execs scripts/install-ai.sh, so the # repo-root computation survives being invoked as a symlink from anywhere. |
