redux-devtools/packages/redux-devtools-inspector-monitor-test-tab/src/templateForm.ts
Nathan Bierema 9fdd298dc3
chore(test): rename test-generator to test-tab (#649)
* chore(test): rename test-generator to test-tab

* And those

* Prettify
2020-10-04 00:01:46 -04:00

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}
});`,
};