2018-12-23 03:13:56 +03:00
|
|
|
export const formSchema = {
|
|
|
|
type: 'object',
|
|
|
|
required: ['name'],
|
|
|
|
properties: {
|
|
|
|
name: {
|
|
|
|
type: 'string',
|
2020-08-08 23:26:39 +03:00
|
|
|
title: 'Template name',
|
2018-12-23 03:13:56 +03:00
|
|
|
},
|
|
|
|
dispatcher: {
|
|
|
|
type: 'string',
|
2020-08-08 23:26:39 +03:00
|
|
|
title: 'Dispatcher: ({ action, prevState }) => (`<template>`)',
|
2018-12-23 03:13:56 +03:00
|
|
|
},
|
|
|
|
assertion: {
|
|
|
|
type: 'string',
|
2020-08-08 23:26:39 +03:00
|
|
|
title: 'Assertion: ({ curState }) => (`<template>`)',
|
2018-12-23 03:13:56 +03:00
|
|
|
},
|
|
|
|
wrap: {
|
|
|
|
type: 'string',
|
2020-08-08 23:26:39 +03:00
|
|
|
title:
|
|
|
|
'Wrap code: ({ name, initialState, assertions }) => (`<template>`)',
|
|
|
|
},
|
|
|
|
},
|
2018-12-23 03:13:56 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
export const uiSchema = {
|
|
|
|
dispatcher: {
|
2020-08-08 23:26:39 +03:00
|
|
|
'ui:widget': 'textarea',
|
2018-12-23 03:13:56 +03:00
|
|
|
},
|
|
|
|
assertion: {
|
2020-08-08 23:26:39 +03:00
|
|
|
'ui:widget': 'textarea',
|
2018-12-23 03:13:56 +03:00
|
|
|
},
|
|
|
|
wrap: {
|
2020-08-08 23:26:39 +03:00
|
|
|
'ui:widget': 'textarea',
|
|
|
|
},
|
2018-12-23 03:13:56 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
export const defaultFormData = {
|
|
|
|
dispatcher: 'state = reducers(${prevState}, ${action});',
|
|
|
|
assertion: 't.deepEqual(state, ${curState});',
|
|
|
|
wrap: `test('reducers', (t) => {
|
|
|
|
\${assertions}
|
2020-08-08 23:26:39 +03:00
|
|
|
});`,
|
2018-12-23 03:13:56 +03:00
|
|
|
};
|