feat(cabana): accept preset on mltext fields
- compilePresetKey admits a text or mltext target - checkPresets admits a text or mltext source - TestPresetML pins every text/mltext pairing and the refusals
This commit is contained in:
@@ -372,9 +372,9 @@ func TestPresetSchema(t *testing.T) {
|
||||
{"mapping with exact", " preset: name\n", " preset:\n field: name\n type: exact\n", ""},
|
||||
{"unsupported type", " preset: name\n", " preset:\n field: name\n type: camel\n", "preset type camel is not supported (want slug or exact)"},
|
||||
{"unknown key", " preset: name\n", " preset:\n field: name\n prefix: x\n", "preset: unknown field prefix"},
|
||||
{"not a text target", " type: checkbox\n default: true\n", " type: checkbox\n default: true\n preset: name\n", "preset is only valid on type: text"},
|
||||
{"not a text target", " type: checkbox\n default: true\n", " type: checkbox\n default: true\n preset: name\n", "preset is only valid on type: text or mltext"},
|
||||
{"unknown source", " preset: name\n", " preset: title\n", "field slug: preset field title is not a field of this form"},
|
||||
{"source is not text", " preset: name\n", " preset: notify\n", "field slug: preset field notify must be a text field"},
|
||||
{"source is not text", " preset: name\n", " preset: notify\n", "field slug: preset field notify must be a text or mltext field"},
|
||||
{"itself", " preset: name\n", " preset: slug\n", "field slug: preset names the field itself"},
|
||||
} {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user