Repository navigation
Conversation
The Liquid field-rendering loop with its `{% case f.type %}` dispatch is
duplicated byte-identically across six templates — the built-in
`default.liquid` plus the five ejectable branding designs, which are
deliberately self-contained so `zitadel branding eject --design X` writes a
standalone file (ADR 037).
The catalog parity test loops every design, but its shared fixture declared
only `email` and `remember`, so the `select` arm — the one that serialises
`f.validation.enum` into `<zl-select options=...>` — was never reached for
the five branding designs. It was covered only through `default.liquid`, so
a hand-edit that broke one design's select branch shipped green.
Add a required `select` field with a closed enum to the fixture and assert,
per design, that the rendered `<zl-select>` carries its localised label, its
required flag, and options built from the enum. The assertion parses the
HTML and reads the decoded attribute rather than string-matching, because
the value passes through two escaping hops (Liquid's `outputEscape` encodes
the `| json` output, then the serialiser re-encodes it).
The mandatory-gates test also gains a duplicate check for the new field: a
*required* select must not trip the safety net into appending a generic
`<zl-field>` alongside it. That regression was previously guarded only in
isolation in `mandatory-gates.spec.ts`; it is now proven per design through
the real pipeline.
No shared partial extracted — the six copies stay as they are.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
Member
Author
|
relates to #398 |
Contributor
|
This branch was previously deployed
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
{% for f in fields %}with a{% case f.type %}dispatch overcheckbox/select/ default input) is duplicated byte-identically across six templates: the built-inpackages/components/src/orchestrator/templates/default.liquidplus the five ejectable branding designs underpackages/config/defaults/branding/*/login.liquid. The duplication is deliberate — each design is self-contained sozitadel branding eject --design Xwrites a standalone file (ADR 037, feat: tenant login templates as editable config (ADR 037) #563).BRANDING_DESIGNS, but its shared fixture declared onlyemail(typeemail) andremember(typecheckbox). Theselectarm — the one that renders<zl-select options='{{ f.validation.enum | selectOptions | json }}'>— was therefore never reached for the five branding designs; it was covered only throughdefault.liquid's own tests. A hand-edit that broke one design's select branch shipped green.selectfield with a closedvalidation.enumto the fixture step and asserts, per design, that the rendered<zl-select>carries its localised label, itsrequiredflag, andoptionsbuilt from the enum. Existing email/checkbox assertions are unchanged.consumes its mandatory_gates markertest gains a duplicate check for the new field: a required select must not trip the safety net into appending a generic<zl-field>alongside it. That regression was previously guarded only in isolation inmandatory-gates.spec.ts; it is now proven per design through the real pipeline.No shared partial was extracted — that is a separate open design question, and the six copies stay as they are.
Validation
moon run components:test— 33 files, 425 tests passed (32 indesign-templates.spec.ts, up from 27).moon run components:typecheck components:lint— clean; no new lint warnings attributable to the spec.pnpm exec oxfmt --check packages/components/src/orchestrator/design-templates.spec.ts— formatted.git statusclean, only the spec is modified):options='…'fromminimal/login.liquid→ exactly one failure,minimalonly (expected null to deeply equal [ Array(2) ]);{% when 'select' %}arm fromsplit/login.liquid→ exactly one failure,splitonly (expected null not to be null— the field falls through to the<zl-field>default arm).Release notes / changeset
*.spec.tschange (.changeset/README.md#decision-table, row 3), which is also why the title type istest.Notes
optionsattribute rather than string-matching it. The value passes through two escaping hops — Liquid runs withoutputEscape: "escape", so the| jsonoutput is HTML-encoded before the sanitiser's serialiser re-encodes it — and aJSON.parseround-trip is both stronger and immune to that churn.optionsis already onzlSelectManifest.attrs, so it survives the DOMPurify pass; the test would catch it if that ever changed.department, enum["Engineering", "Support"]) matches the existing select fixture idiom inembedding.browser.spec.ts.moon run components:testfails withtsx/tsdown/orval: command not founduntilpnpm install --frozen-lockfilehas been run.