feat(cabana): add mltextarea field type
- mltextarea compiles (with size), binds as a writable scalar and goes through the mltext lift, translation write and hydrate paths - preset on or from an mltextarea field stays refused - tests: compile, Postgres round trip over a nullable host column with multi-line text, invalid locale maps, preset refusals
This commit is contained in:
@@ -127,6 +127,32 @@ func TestPresetML(t *testing.T) {
|
||||
`,
|
||||
checkErr: "field slug: preset field body must be a text or mltext field",
|
||||
},
|
||||
{
|
||||
name: "mltextarea target is refused",
|
||||
yaml: `fields:
|
||||
title:
|
||||
type: mltext
|
||||
label: Title
|
||||
excerpt:
|
||||
type: mltextarea
|
||||
label: Excerpt
|
||||
preset: title
|
||||
`,
|
||||
compileErr: "preset is only valid on type: text or mltext",
|
||||
},
|
||||
{
|
||||
name: "mltextarea source is refused",
|
||||
yaml: `fields:
|
||||
excerpt:
|
||||
type: mltextarea
|
||||
label: Excerpt
|
||||
slug:
|
||||
type: mltext
|
||||
label: Slug
|
||||
preset: excerpt
|
||||
`,
|
||||
checkErr: "field slug: preset field excerpt must be a text or mltext field",
|
||||
},
|
||||
}
|
||||
for _, tc := range cases {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user