diff --git a/test/shell.d/config-test.sh b/test/shell.d/config-test.sh index 7ee5a869..09aaa32f 100755 --- a/test/shell.d/config-test.sh +++ b/test/shell.d/config-test.sh @@ -371,9 +371,11 @@ pass "bar defaults restores the stock bar" HOME="$TMPDIR/home" OMARCHY_PATH="$ROOT" PATH="$mock_path" OMARCHY_TEST_DROPBOX=1 OMARCHY_TEST_TAILSCALE=1 omarchy-bar defaults jq -e ' def ids: map(.id // .); - (.bar.layout.center | ids) as $center | - (.bar.layout.right | ids | index("omarchy.dropbox") == 1) and - ($center | index("omarchy.tailscale") == (($center | index("omarchy.weather")) + 1)) + (.bar.layout.right | ids) as $right | + ($right | index("omarchy.tray")) as $tray | + ($right | index("omarchy.tailscale") == $tray + 1) and + ($right | index("omarchy.dropbox") == $tray + 2) and + (.bar.layout.center | ids | index("omarchy.tailscale") == null) ' "$TMPDIR/home/.config/omarchy/shell.json" >/dev/null pass "bar defaults places plugins for running optional services" @@ -382,26 +384,31 @@ HOME="$TMPDIR/home" OMARCHY_PATH="$ROOT" PATH="$mock_path" \ omarchy-bar defaults jq -e ' def ids: map(.id // .); - (.bar.layout.center | ids) as $center | - (.bar.layout.right | ids | index("omarchy.dropbox") == 1) and - ($center | index("omarchy.tailscale") == (($center | index("omarchy.weather")) + 1)) + (.bar.layout.right | ids) as $right | + ($right | index("omarchy.tray")) as $tray | + ($right | index("omarchy.tailscale") == $tray + 1) and + ($right | index("omarchy.dropbox") == $tray + 2) and + (.bar.layout.center | ids | index("omarchy.tailscale") == null) ' "$TMPDIR/home/.config/omarchy/shell.json" >/dev/null pass "bar defaults places service widgets without a running shell" HOME="$TMPDIR/home" OMARCHY_PATH="$ROOT" PATH="$mock_path" OMARCHY_TEST_DROPBOX=0 OMARCHY_TEST_TAILSCALE=0 omarchy-refresh-shell jq -e ' def ids: map(.id // .); - (.bar.layout.right | ids | index("omarchy.dropbox") == null) and - (.bar.layout.center | ids | index("omarchy.tailscale") == null) + ([.bar.layout.left, .bar.layout.center, .bar.layout.right] | map(ids) | add) as $all | + ($all | index("omarchy.dropbox") == null) and + ($all | index("omarchy.tailscale") == null) ' "$TMPDIR/home/.config/omarchy/shell.json" >/dev/null pass "shell refresh keeps optional service widgets absent when services are unavailable" HOME="$TMPDIR/home" OMARCHY_PATH="$ROOT" PATH="$mock_path" OMARCHY_TEST_DROPBOX=1 OMARCHY_TEST_TAILSCALE=1 omarchy-refresh-shell jq -e ' def ids: map(.id // .); - (.bar.layout.center | ids) as $center | - (.bar.layout.right | ids | index("omarchy.dropbox") == 1) and - ($center | index("omarchy.tailscale") == (($center | index("omarchy.weather")) + 1)) + (.bar.layout.right | ids) as $right | + ($right | index("omarchy.tray")) as $tray | + ($right | index("omarchy.tailscale") == $tray + 1) and + ($right | index("omarchy.dropbox") == $tray + 2) and + (.bar.layout.center | ids | index("omarchy.tailscale") == null) ' "$TMPDIR/home/.config/omarchy/shell.json" >/dev/null [[ -f $TMPDIR/home/.local/state/omarchy/restart-shell-called ]] || fail "shell refresh restarts shell" pass "shell refresh places optional service widgets when services are available"