test(core-components): cover invalid mustache patterns in prompt template - #223
Merged
Merged
Conversation
…late Add 4 @stable @regression @components tests exercising the mustache parser rejection contract (use_double_brackets toggle ON): - {{ var }} (spaces inside braces) — SIMPLE_VARIABLE_PATTERN miss - {{var.attr}} (dot notation) — SIMPLE_VARIABLE_PATTERN miss - {{#section}}{{/section}} — DANGEROUS_PATTERNS hit - {{{var}}} (triple braces) — DANGEROUS_PATTERNS hit Each case was probed against POST /api/v1/validate/prompt with mustache=true on Langflow 1.10.x before the spec was written, confirming HTTP 500 with the two distinct upstream messages the spec asserts on. The error toast (.error-build-message) and isEdit=true behavior surface through the mustache modal's onError callback in mustachePromptModal/index.tsx — same rendering path as the f-string sibling spec.
…spec Replace the 'follow-up planned' stubs in the f-string invalid-patterns and double-brackets spec docs with pointers to the now-existing prompt-template-invalid-mustache-patterns-regression.spec.ts.
Add 4 [x] bullets under §3.2 Prompt Template covering the mustache parser rejection contract. The Phase 0 — Validated block was regenerated by npm run coverage:summary (128 → 132 @stable test() calls).
Contributor
There was a problem hiding this comment.
Pull request overview
Adds automated regression coverage for Prompt Template mustache-mode validation failures, ensuring forbidden mustache syntaxes continue to be rejected and surfaced via the UI error toast. This complements the existing f-string invalid-pattern coverage and documents the expected rejection contract.
Changes:
- Adds a new Playwright spec with 4
@stable @regression @componentstests covering invalid mustache patterns ({{ var }},{{var.attr}},{{#section}}{{/section}},{{{var}}}). - Updates QA checklist counts and Phase 0 validated bullets to include the new stable tests.
- Adds/updates docs to describe the mustache invalid-pattern regression spec and cross-link it from related Prompt Template docs.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/tests-automations/regression/core-components/prompt-template-invalid-mustache-patterns-regression.spec.ts | New serial Playwright spec asserting mustache validator rejection contract + “no dynamic handle created” behavior. |
| QA-CHECKLIST.md | Adds 4 validated bullets for the new spec and updates coverage totals/Phase 0 stable test counts. |
| docs/core-components/prompt-template-invalid-patterns-regression.md | Updates “does not cover” section to point to the new mustache invalid-pattern spec. |
| docs/core-components/prompt-template-invalid-mustache-patterns-regression.md | New documentation describing scope, contract, dependencies, and validation criteria for the mustache invalid-pattern tests. |
| docs/core-components/prompt-template-double-brackets-regression.md | Updates “does not cover” section to reference the new mustache invalid-pattern spec. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…s race Snapshot toast.textContent() once after toBeVisible resolves, then run the title and detail assertions against the captured string. The previous toContainText calls inherited Playwright's 5s expect default, which could race the .error-build-message 5s auto-dismiss timer if visibility resolved near the dismissal boundary. Snapshot pattern eliminates the race. Also pin the modal-stays-visible assertion in step 5 to an explicit 5s timeout, mirroring the toast lifetime — makes the bound visible at the call site instead of inheriting it implicitly.
This was referenced May 12, 2026
Closed
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.
Summary
@stable @regression @componentstests exercising the mustache parser rejection contract (withuse_double_bracketstoggle ON):{{ var }}(spaces inside braces) and{{var.attr}}(dot notation) —SIMPLE_VARIABLE_PATTERNmiss branch{{#section}}{{/section}}and{{{var}}}(triple braces) —DANGEROUS_PATTERNSregex-hit branchPOST /api/v1/validate/promptwithmustache=trueon Langflow 1.10.x before the spec was written — all 4 return HTTP 500 with the two distinct upstream messages the spec asserts on.@stabletests).Test plan
npx playwright test tests/tests-automations/regression/core-components/prompt-template-invalid-mustache-patterns-regression.spec.ts— 4 passed (17.5s)npm run typecheck— cleannpm run lint— no new errorsnpm run coverage:summary— idempotent regenerationNotes
addPromptComponent,dynamicHandlesLocator,errorToastLocator,fillAndSaveMustacheTemplate) is intentional in this PR and tracked by refactor(core-components): extract shared Prompt Template test helpers #222, which now lists the 4th spec in its scope.Closes #221
🤖 Generated with Claude Code