fix(admin): restore suite after colorpicker and codeeditor registration
- Expect colorpicker/codeeditor as registered controls; use notatype for unsupported cases - Seed DatePicker placeholder from the model value so the calendar opens on that month - Make CodeEditor chunk-failure mock reject the dynamic import Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -13,6 +13,8 @@ import MLTextareaField from '../../src/components/form/fields/MLTextareaField.vu
|
||||
import MLTextField from '../../src/components/form/fields/MLTextField.vue'
|
||||
import PasswordField from '../../src/components/form/fields/PasswordField.vue'
|
||||
import PermissionEditorField from '../../src/components/form/fields/PermissionEditorField.vue'
|
||||
import ColorPickerField from '../../src/components/form/fields/ColorPickerField.vue'
|
||||
import CodeEditorField from '../../src/components/form/fields/CodeEditorField.vue'
|
||||
import UnsupportedField from '../../src/components/form/fields/UnsupportedField.vue'
|
||||
import WidgetField from '../../src/components/form/fields/WidgetField.vue'
|
||||
import MLPluginField from '../../src/components/form/fields/MLPluginField.vue'
|
||||
@@ -45,19 +47,21 @@ describe('field renderer registry (D-05)', () => {
|
||||
['switch', SwitchField],
|
||||
['checkbox', CheckboxField],
|
||||
['relation', RelationField],
|
||||
['colorpicker', ColorPickerField],
|
||||
['codeeditor', CodeEditorField],
|
||||
[RELATION_MANAGER, RelationManager],
|
||||
])('renders %s with its control', (type, component) => {
|
||||
expect(rendererFor(type)).toBe(component)
|
||||
})
|
||||
|
||||
it.each(['colorpicker', 'codeeditor', '', 'TEXT', 'constructor'])('falls back to UnsupportedField for %j', (type) => {
|
||||
it.each(['notatype', '', 'TEXT', 'constructor'])('falls back to UnsupportedField for %j', (type) => {
|
||||
expect(rendererFor(type)).toBe(UnsupportedField)
|
||||
expect(isRegistered(type)).toBe(false)
|
||||
})
|
||||
|
||||
it('edits values of every control type except the record-bound relation manager', () => {
|
||||
expect(RELATION_MANAGER).toBe('relation-manager')
|
||||
for (const type of ['text', 'textarea', 'number', 'dropdown', 'switch', 'checkbox', 'relation']) {
|
||||
for (const type of ['text', 'textarea', 'number', 'dropdown', 'switch', 'checkbox', 'relation', 'colorpicker', 'codeeditor']) {
|
||||
expect(isRegistered(type), type).toBe(true)
|
||||
expect(needsRecord(type), type).toBe(false)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user