Open
fix(acceptance): parent-FK field must be a native <select> (Playwright selectOption) — relational-slice park#174
Conversation
…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.
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
build35 Contact reached the fast-gate GREEN, then parked at acceptance: the parent foreign-key field
contact-field-companyIdwas built as an<input>, but the E2E create step uses Playwrightlocator.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
selectOptioncorrectly)buildTestIdGuide:<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.<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 (selectOptionneeds a real<select>, else the create step fails / the feature parks).<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