mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2024-11-25 19:13:56 +03:00
9fdd298dc3
* chore(test): rename test-generator to test-tab * And those * Prettify
46 lines
986 B
TypeScript
46 lines
986 B
TypeScript
import { Template } from './types';
|
|
|
|
export const formSchema = {
|
|
type: 'object' as const,
|
|
required: ['name'],
|
|
properties: {
|
|
name: {
|
|
type: 'string' as const,
|
|
title: 'Template name',
|
|
},
|
|
dispatcher: {
|
|
type: 'string' as const,
|
|
title: 'Dispatcher: ({ action, prevState }) => (`<template>`)',
|
|
},
|
|
assertion: {
|
|
type: 'string' as const,
|
|
title: 'Assertion: ({ curState }) => (`<template>`)',
|
|
},
|
|
wrap: {
|
|
type: 'string' as const,
|
|
title:
|
|
'Wrap code: ({ name, initialState, assertions }) => (`<template>`)',
|
|
},
|
|
},
|
|
};
|
|
|
|
export const uiSchema = {
|
|
dispatcher: {
|
|
'ui:widget': 'textarea',
|
|
},
|
|
assertion: {
|
|
'ui:widget': 'textarea',
|
|
},
|
|
wrap: {
|
|
'ui:widget': 'textarea',
|
|
},
|
|
};
|
|
|
|
export const defaultFormData: Template = {
|
|
dispatcher: 'state = reducers(${prevState}, ${action});',
|
|
assertion: 't.deepEqual(state, ${curState});',
|
|
wrap: `test('reducers', (t) => {
|
|
\${assertions}
|
|
});`,
|
|
};
|