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:
1 parent
c164211480
commit
90394464e0
1 file changed
+13
-1
+13
-1
@@ -109,6 +109,9 @@ check_json() {
|
|||||||
check_json "$SETTINGS_SRC" \
|
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"' \
|
'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"
|
"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)"
|
MERGE_HOME="$(new_home)"
|
||||||
MERGED="$MERGE_HOME/.claude/settings.json"
|
MERGED="$MERGE_HOME/.claude/settings.json"
|
||||||
@@ -118,7 +121,8 @@ cat > "$MERGED" << 'EOF'
|
|||||||
"theme": "light",
|
"theme": "light",
|
||||||
"permissions": {"allow": ["Bash(ls:*)"]},
|
"permissions": {"allow": ["Bash(ls:*)"]},
|
||||||
"env": {"MY_VAR": "kept", "CLAUDE_CODE_DISABLE_SHIP": "0"},
|
"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
|
EOF
|
||||||
chmod 640 "$MERGED"
|
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"
|
"the repo's value wins where both set one"
|
||||||
check_json "$MERGED" 's["disableBundledSkills"] is True and s["syncClaudeAiSkills"] is False' \
|
check_json "$MERGED" 's["disableBundledSkills"] is True and s["syncClaudeAiSkills"] is False' \
|
||||||
"settings only the repo has are added"
|
"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
|
if [[ "$(find "$MERGED" -perm 640)" == "$MERGED" ]]; then
|
||||||
pass "the existing file's permissions are kept"
|
pass "the existing file's permissions are kept"
|
||||||
|
|||||||
Reference in new issue
Block a user