aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rwxr-xr-xtests/e2e.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/e2e.sh b/tests/e2e.sh
index 50d7fa7..1a5cba0 100755
--- a/tests/e2e.sh
+++ b/tests/e2e.sh
@@ -303,6 +303,30 @@ else
fail "menu bar binary not found at $MENUBAR"
fi
+# --- 14. clicks work with launchd's environment ------------------------------
+# launchd starts the menu bar app with PATH=/usr/bin:/bin:/usr/sbin:/sbin,
+# which has no Homebrew tmux; every click runs `dingger focus` from there.
+echo "14. launchd environment"
+launchd_env() {
+ env -i HOME="$HOME" PATH=/usr/bin:/bin:/usr/sbin:/sbin DINGGER_TMUX_SOCKET="$SOCK" \
+ DINGGER_AGENT_SOCKET="$HOOK" DINGGER_BIN="$DINGGER" "$@"
+}
+t switch-client -c "$CLIENT" -t "$B1"
+expect "client back on wb1" "client_window" wb1
+hook "$A1" working; hook "$A1" idle
+expect "A1 done" "opt $A1 @agent_state" done
+if [ -x "$MENUBAR" ]; then
+ launchd_env "$MENUBAR" --click "$A1" 2>"$DIR/click.err"
+ expect "menu bar row click jumps, under launchd's PATH" "client_window" wa1
+ expect "A1 idle after that click" "opt $A1 @agent_state" idle
+fi
+t switch-client -c "$CLIENT" -t "$B1"
+expect "client back on wb1" "client_window" wb1
+hook "$A2" working; hook "$A2" idle
+expect "A2 done" "opt $A2 @agent_state" done
+launchd_env "$DINGGER" focus
+expect "dingger focus (jump shortcut) jumps, under launchd's PATH" "client_window" wa2
+
echo
echo "$PASSES passed, $FAILS failed"
[ "$FAILS" -eq 0 ] || { echo "--- daemon log tail"; tail -30 "$DIR/daemon.log"; exit 1; }