Add staging integration test suite for status history - #2
Merged
Conversation
Zero-dependency Node script (test/staging/run.mjs) that exercises the status-history feature against a live Discourse instance over the HTTP API, verifying both the topic custom_fields state machine and the recorded TopicStatusChange rows (read back via Data Explorer). See test/staging/README.md. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
darreneid
force-pushed
the
staging-test-suite
branch
from
July 28, 2026 16:48
4b3bb52 to
00ca01e
Compare
This was referenced Jul 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A standalone integration suite (
test/staging/run.mjs) that exercises the community-custom-fields status-history feature against a live Discourse instance over the HTTP API. Complements the unit/system specs and the feature in #1.How it works
Api-Usernameon a global key):POST /posts.json, the adminPUTcustom-fields endpoint, andGET /t/:id.json.custom_fieldsstate machine, and the actual rows written tocommunity_custom_fields_topic_status_changes, read back through Data Explorer (creates a temp parameterized query, runs it per topic, deletes it on teardown).Checks
topic_created seeds
new+ no row ·api_updaterow (user/no-post/duration) · invalid status → 422 + nothing · no-op status → no row · customer reply reopens snoozed (post_id/null user/pre-change assignee) · admin whisper reopen (skips if whispers off) · admin reply clears waiting → no row · all valid statuses accepted.Requirements
An admin — ideally "All Users" (global) — API key, and
discourse-data-explorerenabled on the target. Seetest/staging/README.md.Testing
Validated against a local Discourse dev instance (real HTTP + real rows): 8/8 pass, cleanup confirmed. Lives under
test/staging/as.mjs, outside the plugin's lint globs, so it doesn't affect CI.🤖 Generated with Claude Code