// @vitest-environment happy-dom // // `readonly` field handling in the generic record dialog + action modal. // // A `readonly` field is server/system-generated (e.g. the GitHub addon's // `number`/`github_url`, filled by the API after the outbound create). Kernel // v0.64.0 stamps `FieldDef.readonly` on such fields served by DeriveFormFields. // UI semantics: // - CREATE: the field is excluded from the form entirely (`filterVisibleFields`) // — the user can't set a value the server will overwrite. // - EDIT: the field is shown, but as a disabled/muted input // (`ReadonlyEditField`) — the value is visible, not editable. // - VIEW: unchanged (rich read-only renderer). // // The last block covers action fields with a materialized `options_source`: ops // turns them into `type:'select'` with server-populated `options`, and the modal // must render a for it. expect( resolveWidget({ key: 'status', label: 'Estado', type: 'select', options: [ { value: 'open', label: 'Abierto' }, { value: 'closed', label: 'Cerrado' }, ], } as any), ).toBe('select') }) })