Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

fix(acceptance): parent-FK field must be a native <select> (Playwright selectOption) — relational-slice park#174

Open
agjs wants to merge 4 commits into
mainagjs/tsforge:mainfrom
fix/parent-fk-selectagjs/tsforge:fix/parent-fk-selectCopy head branch name to clipboard
Open

fix(acceptance): parent-FK field must be a native <select> (Playwright selectOption) — relational-slice park#174
agjs wants to merge 4 commits into
mainagjs/tsforge:mainfrom
fix/parent-fk-selectagjs/tsforge:fix/parent-fk-selectCopy head branch name to clipboard

Conversation

@agjs

@agjs agjs commented Jul 23, 2026

Copy link
Copy Markdown
Owner

What

build35 Contact reached the fast-gate GREEN, then parked at acceptance: the parent foreign-key field contact-field-companyId was built as an <input>, but the E2E create step uses Playwright locator.selectOption, which only works on a native <select>. The model even diagnosed it ("I need to change the companyId field from an Input to a Select") but the escalation ladder exhausted first. This is the relational-slice (belongsTo) wall for slice 2+.

Root cause = the guide (the E2E generator already uses selectOption correctly)

buildTestIdGuide:

  • No longer lists parent-FK fields among the plain <input> form fields — that double-listing is what led the model to build an <input>. Non-FK fields are still listed as inputs; FK fields are flagged "NOT plain inputs" and deferred to the relationship selectors.
  • Mandates a native <select> for each parent FK, populated with one <option> per parent record (value = parent id, fetched via the parent's list query), and explains why (selectOption needs a real <select>, else the create step fails / the feature parks).
  • Pattern example now derives a NON-relationship field (never renders an FK as <input>); the all-FK case shows a <select>; the empty-fields case invents no field and emits no row-cell example. "Where to add them" says each field's control is an <input> for plain fields, a native <select> for a parent FK.

Tests (panel-clean over 4 rounds)

27 testid-contract tests, including distinguishing fixtures the Contact fixture can't exercise: fkFirstEntity (first field IS the FK → example must name the non-FK field, never the FK as <input>), allFkEntity (only field is FK → <select>, no invented rowCell), and an empty-fields fixture (no invented field, no row-cell example). Full core suite 3036 pass, 0 fail.

🤖 Generated with Claude Code

agjs added 4 commits July 24, 2026 00:13
…t selectOption) — #79

build35 Contact reached fast-gate GREEN then PARKED at acceptance: the parent foreign-key field
contact-field-companyId was built as an <input>, but the E2E create step uses Playwright
locator.selectOption, which ONLY works on a native <select>. The model diagnosed it ('I need to
change the companyId field from an Input to a Select') but the ladder exhausted first.

Root-cause the GUIDE (the E2E generator already correctly uses selectOption):
- buildTestIdGuide no longer lists parent-FK fields among the plain <input> form fields (that
  double-listing is what led the model to build an <input>); non-FK fields still listed as inputs.
- The Relationship-selectors section now MANDATES a native <select> for each parent FK, populated
  with one <option> per parent record (value = parent id), fetched via the parent's list query —
  and explains WHY (selectOption needs a real <select>, else the create step fails / feature parks).

Tests: guide directs parent FK to a native <select> + selectOption + the <select data-testid=…>
form; guide does NOT list the FK among plain inputs (flagged 'NOT plain inputs') while non-FK fields
remain listed. 24 testid-contract tests; full core suite 3033 pass, 0 fail.
…Pattern example (#79 panel round-2)

Panel BLOCK round-2, addressed:
- missing-test (ag3): the 'FK not among plain inputs' test only checked for the warning text; it
  would still pass if companyId stayed in the plain-input list. Now asserts the EXACT plain-field
  bullet phrasing for companyId is ABSENT (it lives only in the <select> Relationship-selectors
  section) — so the double-listing regression that caused the park is protected.
- minor: the Pattern example used entity.fields[0], which could be a parent FK (contradicting the
  <select> mandate). Now derives exampleField = first NON-relationship field, and notes a parent FK
  is a <select> instead.
- minor: 'Where to add them' no longer says '…to each input'; it now says each field's control is an
  <input> for plain fields, a native <select> for a parent FK.

24 testid-contract tests; full core suite 3033 pass, 0 fail.
…fix (#79 panel round-3)

Panel round-2 correctly flagged that the exampleField fix was not MEANINGFULLY tested: the Contact
fixture's fields[0] is 'name' (already non-FK), so old (fields[0]) and new (find non-FK) code agree —
a regression would pass. Plus the fallback rendered an FK as <input> when every field is an FK.

- Code: when there is NO plain (non-FK) field, the Pattern example now shows the FK as a native
  <select> (never an <input>); the empty-fields case shows a generic <input> note with no invented
  field name.
- Tests: two new fixtures — fkFirstEntity (first field IS the FK 'userId', with a non-FK 'role') and
  allFkEntity (only field is the FK). Assert: FK-first → example names the non-FK 'role' as <input>
  and NEVER the FK as <input>; all-FK → example shows <select> for the FK, never <input>.

26 testid-contract tests; full core suite 3035 pass, 0 fail.
…ield (#79 residuals)

Panel round-3 PASSED but noted ag1 residuals in the row-cell Pattern example; closed them:
- rowExampleLine is now emitted ONLY when entity.shows has a real column (rowCell testids exist for
  entity.shows only), so it never invents 'name' and never references a rowCell testid absent from
  the Complete contract (the all-FK / empty-fields cases previously did both).
- Tests: all-FK entity asserts NO row-cell example + no rowCell(userId); new empty-fields fixture
  asserts no invented field, no record.name, no row-cell example — falls to the generic form note.

27 testid-contract tests; full core suite green.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.