diff --git a/tests/scripts.bats b/tests/scripts.bats index 5b7fe1b..86d18cd 100644 --- a/tests/scripts.bats +++ b/tests/scripts.bats @@ -51,3 +51,18 @@ load helpers python3 "$SKILL_SCRIPTS/index-append.py" --section Sources --entry '- [[sources/dup]] — d. `maturity: draft`' [ "$(grep -c 'sources/dup' wiki/index.md)" -eq 1 ] } + +@test "index-append: updates an existing entry by wikilink path (no duplicate)" { + G="$(make_fixture_genome)"; cd "$G" + python3 "$SKILL_SCRIPTS/index-append.py" --section Sources --entry '- [[sources/foo]] — old summary. `maturity: draft`' + python3 "$SKILL_SCRIPTS/index-append.py" --section Sources --entry '- [[sources/foo]] — new summary. `maturity: stable`' + [ "$(grep -c 'sources/foo' wiki/index.md)" -eq 1 ] + grep -q 'new summary' wiki/index.md + ! grep -q 'old summary' wiki/index.md +} + +@test "slug: refuses an all-symbols input (no empty slug)" { + run bash "$SKILL_SCRIPTS/slug.sh" "!!!.md" + [ "$status" -ne 0 ] + [ -z "$output" ] || [[ "$output" != *"feat/ai-ingest-"* ]] +}