test: add E2E template variable rendering tests #59
Reference in New Issue
Block a user
Delete Branch "fix/52-template-variable-rendering"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Added comprehensive E2E test coverage for template variable rendering in LiquidJS templates, specifically addressing issue #52 where payload variables were reported as not being filled in rendered output.
Why
Issue #52 reported that when rendering nodes with registered LiquidJS templates, payload variables (name, age, etc.) appeared empty in output. Investigation revealed this was a user error - LiquidJS templates require payload.name syntax rather than name to access node payload properties.
Changes
Verification
Ref
Fixes #52
Add comprehensive test suite (Suite 9 and 10) covering template variable rendering: - Suite 9: E2E Template Variable Rendering (12 tests) - Tests correct {{ payload.* }} syntax vs incorrect direct property access - Tests primitive payloads (string, number) - Tests nested objects, arrays, null values, booleans - Tests edge cases: empty strings, zero values, special characters - Validates CLI integration flow - Suite 10: Context Variable Completeness (2 tests) - Verifies context propagation through recursive renders - Tests context isolation between parent and child nodes All tests pass. Confirms the renderNode function correctly passes node.payload to template context. Issue #52 was user error - templates require {{ payload.name }} syntax, not {{ name }}. Fixes #52 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>LGTM ✅ 纯测试 PR,覆盖全面。