UNPKG

@tomino/dynamic-form-semantic-ui

Version:

Semantic UI form renderer based on dynamic form generation

54 lines 1.39 kB
import { create } from './form_query_data'; import { prepareComponent, testStandard, testEditor } from './common'; const schema = { type: 'object', properties: { description: { type: 'string' } }, required: ['name'] }; const formDefinition = create.stack({ elements: [ { props: { label: 'Description', icon: 'doctor', color: 'red', content: { source: 'description' } }, control: 'Comment' }, { props: { label: 'Description', icon: 'comment outline', color: 'yellow', content: 'Direct description', header: 'This is header' }, control: 'Comment' } ] }); const data = { description: 'Some Description' }; describe('Comment', () => { it('renders standard', () => { testStandard(formDefinition, schema, data); }); it('renders editor', () => { testEditor(formDefinition, schema, data); }); return { component: prepareComponent(formDefinition, schema, data, { addEditor: true, showToolBox: false, showStandard: true, validate: true }) }; }); //# sourceMappingURL=comment_view.test.js.map