From cb41f9e877563848e3cbac9fc5b26e15889ed5b5 Mon Sep 17 00:00:00 2001 From: Jan-Niclas Loosen Date: Mon, 19 Oct 2026 18:17:41 +0200 Subject: [PATCH] =?UTF-8?q?test:=20Smoke=20pr=C3=BCft=20Bereichs-=20und=20?= =?UTF-8?q?Schl=C3=BCssel-Ablehnung=20auf=20Grund=20und=20Feld?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 5.5 --- tests/Integration/divi-theme-fonts-smoke.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/Integration/divi-theme-fonts-smoke.sh b/tests/Integration/divi-theme-fonts-smoke.sh index 6ddf411..d313119 100755 --- a/tests/Integration/divi-theme-fonts-smoke.sh +++ b/tests/Integration/divi-theme-fonts-smoke.sh @@ -75,6 +75,11 @@ STALE=$(ability lit/divi-theme-options-update "$(echo "$UPDATE" | jq -c '.set.bo [ "$(error_code "$STALE")" = "rev_mismatch" ] || fail "stale design_rev: $STALE" pass "theme options changed ($THEME_SNAPSHOT), stale design_rev refused" +# refused_for : the call was refused (an error that is not the dry run's confirm_required) and the text names the field. +refused_for() { + [ "$(error_code "$1")" != "confirm_required" ] && echo "$1" | jq -e --arg f "$2" 'has("__error") and (.__error | contains($f))' >/dev/null +} + # 3. Validation. Range and unknown keys are already refused by the input schema (before the plugin runs); unknown font # names and "none" reach the plugin, which collects them with suggestions. Nothing is written in any case. BAD=$(ability lit/divi-theme-options-update '{"set": {"heading_font": "Robotto", "body_font": "none"}}') @@ -82,9 +87,9 @@ BAD=$(ability lit/divi-theme-options-update '{"set": {"heading_font": "Robotto", echo "$BAD" | grep -q 'Roboto' || fail "no font suggestion in: $BAD" echo "$BAD" | grep -q 'body_font' || fail "none not refused with its path: $BAD" BAD=$(ability lit/divi-theme-options-update '{"set": {"body_font_size": 99}}') -echo "$BAD" | jq -e 'has("__error")' >/dev/null || fail "out-of-range size accepted: $BAD" +refused_for "$BAD" body_font_size || fail "out-of-range size not refused for its field: $BAD" BAD=$(ability lit/divi-theme-options-update '{"set": {"colour": 1}}') -echo "$BAD" | jq -e 'has("__error")' >/dev/null || fail "unknown key accepted: $BAD" +refused_for "$BAD" colour || fail "unknown key not refused for its field: $BAD" [ "$(theme_option body_font_size)" = "18" ] || fail "invalid call changed body_font_size" [ "$(theme_option heading_font)" = "" ] || fail "invalid call changed heading_font" pass "unknown font with suggestions, none, range and unknown key refused"