test: add form config validator and HTTP integration test

test-config: static YAML validator for post-form.md — checks that the
add-page-by-form action name, pageconfig/pagefrontmatter blocks, and all
required fields are correctly wired. Fast, no server needed. Catches the
class of bug that caused silent post failures.

test-post: end-to-end HTTP test — logs in, submits the form, verifies an
entry.md was created on disk, then cleans up. Requires GRAV_TEST_USER and
GRAV_TEST_PASS in .env (see .env.example).

  make test-config   # fast, no credentials needed
  make test-post     # full e2e, needs .env credentials
  make test          # both

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-18 19:57:49 +02:00
parent 706d1dee21
commit fb28f09e0c
4 changed files with 192 additions and 0 deletions
+10
View File
@@ -6,6 +6,16 @@ SSH := ssh -p $(REMOTE_PORT) $(REMOTE_USER)@$(REMOTE_HOST)
WEBROOT ?= $(REMOTE_HOME)/public_html
SITE_CONFIG_DIR ?= $(REMOTE_HOME)/site-config
# ── Tests ─────────────────────────────────────────────────────────────────────
test-config:
@bash scripts/test-form-config.sh
test-post:
@bash scripts/test-post.sh
test: test-config test-post
# ── Local dev ──────────────────────────────────────────────────────────────────
start: