test(install): cover the built-in plugin settings and their merge

Refs #286

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi
This commit is contained in:
Defame1297andClaude Opus 5.5 committed 2026-12-06 17:04:36 +00:00
1 parent c164211480
commit 90394464e0
1 file changed
+13 -1
+13 -1
View File
@@ -109,6 +109,9 @@ check_json() {
check_json "$SETTINGS_SRC" \
's["disableBundledSkills"] is True and s["syncClaudeAiSkills"] is False and s["env"]["CLAUDE_CODE_DISABLE_SHIP"] == "1" and s["skillOverrides"]["init"] == "off"' \
"repo settings turn off bundled and synced skills"
check_json "$SETTINGS_SRC" \
'all(s["skillOverrides"][k] == "off" for k in ("design", "doctor", "plugin-authoring")) and s["enabledPlugins"]["cc-plugin-easel@builtin"] is False and s["enabledPlugins"]["cc-plugin-plugin-authoring@builtin"] is False and s["syncClaudeAiPlugins"] is False' \
"repo settings turn off built-in plugin skills and synced plugins"
MERGE_HOME="$(new_home)"
MERGED="$MERGE_HOME/.claude/settings.json"
@@ -118,7 +121,8 @@ cat > "$MERGED" << 'EOF'
"theme": "light",
"permissions": {"allow": ["Bash(ls:*)"]},
"env": {"MY_VAR": "kept", "CLAUDE_CODE_DISABLE_SHIP": "0"},
"skillOverrides": {"other": "off", "init": "on"}
"skillOverrides": {"other": "off", "init": "on"},
"enabledPlugins": {"operator-plugin@x": true, "cc-plugin-easel@builtin": true}
}
EOF
chmod 640 "$MERGED"
@@ -132,6 +136,14 @@ check_json "$MERGED" 's["theme"] == "dark" and s["env"]["CLAUDE_CODE_DISABLE_SHI
"the repo's value wins where both set one"
check_json "$MERGED" 's["disableBundledSkills"] is True and s["syncClaudeAiSkills"] is False' \
"settings only the repo has are added"
check_json "$MERGED" 's["enabledPlugins"]["operator-plugin@x"] is True' \
"the operator's own plugin entries are kept"
check_json "$MERGED" 's["enabledPlugins"]["cc-plugin-easel@builtin"] is False and s["enabledPlugins"]["cc-plugin-plugin-authoring@builtin"] is False' \
"the repo turns off built-in plugins the operator had enabled"
check_json "$MERGED" 's["skillOverrides"]["other"] == "off" and all(s["skillOverrides"][k] == "off" for k in ("design", "doctor", "plugin-authoring"))' \
"new skill overrides are added beside the operator's own"
check_json "$MERGED" 's["syncClaudeAiPlugins"] is False' \
"plugin sync is turned off in merged settings"
if [[ "$(find "$MERGED" -perm 640)" == "$MERGED" ]]; then
pass "the existing file's permissions are kept"