add default value test for normal fields
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import buildStateFromSchema from './buildStateFromSchema';
|
||||
|
||||
describe('Form - buildStateFromSchema', () => {
|
||||
it('populates default value - normal fields', async () => {
|
||||
const defaultValue = 'Default';
|
||||
const fieldSchema = [
|
||||
{
|
||||
name: 'text',
|
||||
type: 'text',
|
||||
label: 'Text',
|
||||
defaultValue,
|
||||
},
|
||||
];
|
||||
const state = await buildStateFromSchema(fieldSchema, {});
|
||||
expect(state.text.value).toBe(defaultValue);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user