@jsonforms/material-renderers 2.5.2-alpha.0 → 3.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/docs/assets/js/search.json +1 -1
- package/docs/classes/combinatorproperties.html +2 -5
- package/docs/classes/materialanyofstringorenumcontrol.html +6 -9
- package/docs/classes/materialtablecontrol.html +4 -7
- package/docs/globals.html +986 -274
- package/docs/index.html +78 -51
- package/docs/interfaces/ajvprops.html +1 -4
- package/docs/interfaces/arraylayouttoolbarprops.html +0 -3
- package/docs/interfaces/categorizationstate.html +0 -3
- package/docs/interfaces/categorizationstepperstate.html +0 -3
- package/docs/interfaces/combinatorpropertiesprops.html +0 -3
- package/docs/interfaces/deletedialogprops.html +0 -3
- package/docs/interfaces/dispatchpropsofexpandpanel.html +3 -6
- package/docs/interfaces/emptytableprops.html +0 -3
- package/docs/interfaces/expandpanelprops.html +19 -22
- package/docs/interfaces/jsonformstheme.html +0 -3
- package/docs/interfaces/materialcategorizationlayoutrendererprops.html +7 -10
- package/docs/interfaces/materialcategorizationstepperlayoutrendererprops.html +7 -10
- package/docs/interfaces/materiallayoutrendererprops.html +0 -3
- package/docs/interfaces/materialtabletoolbarprops.html +10 -13
- package/docs/interfaces/muitextinputprops.html +2 -5
- package/docs/interfaces/nonemptycellcomponentprops.html +266 -0
- package/docs/interfaces/nonemptycellprops.html +0 -3
- package/docs/interfaces/nonemptyrowprops.html +80 -27
- package/docs/interfaces/ownoneofprops.html +0 -3
- package/docs/interfaces/ownpropsofexpandpanel.html +14 -17
- package/docs/interfaces/ownpropsofnonemptycell.html +0 -3
- package/docs/interfaces/statepropsofexpandpanel.html +16 -19
- package/docs/interfaces/tableheadercellprops.html +0 -3
- package/docs/interfaces/tablerowsprop.html +9 -12
- package/docs/interfaces/validationprops.html +0 -3
- package/docs/interfaces/withdeletedialogsupport.html +0 -3
- package/docs/interfaces/withinput.html +1 -4
- package/docs/interfaces/withoptionlabel.html +3 -6
- package/lib/additional/ListWithDetailMasterItem.d.ts +1 -1
- package/lib/additional/ListWithDetailMasterItem.js.map +1 -1
- package/lib/additional/MaterialLabelRenderer.d.ts +1 -1
- package/lib/additional/MaterialLabelRenderer.js +3 -1
- package/lib/additional/MaterialLabelRenderer.js.map +1 -1
- package/lib/additional/MaterialListWithDetailRenderer.d.ts +1 -1
- package/lib/additional/MaterialListWithDetailRenderer.js +5 -3
- package/lib/additional/MaterialListWithDetailRenderer.js.map +1 -1
- package/lib/additional/index.js +3 -2
- package/lib/additional/index.js.map +1 -1
- package/lib/cells/CustomizableCells.d.ts +1 -0
- package/lib/cells/CustomizableCells.js +11 -8
- package/lib/cells/CustomizableCells.js.map +1 -1
- package/lib/cells/MaterialBooleanCell.d.ts +1 -1
- package/lib/cells/MaterialBooleanCell.js +3 -1
- package/lib/cells/MaterialBooleanCell.js.map +1 -1
- package/lib/cells/MaterialBooleanToggleCell.d.ts +1 -1
- package/lib/cells/MaterialBooleanToggleCell.js +3 -1
- package/lib/cells/MaterialBooleanToggleCell.js.map +1 -1
- package/lib/cells/MaterialDateCell.d.ts +1 -1
- package/lib/cells/MaterialDateCell.js +3 -1
- package/lib/cells/MaterialDateCell.js.map +1 -1
- package/lib/cells/MaterialEnumCell.d.ts +1 -1
- package/lib/cells/MaterialEnumCell.js +3 -1
- package/lib/cells/MaterialEnumCell.js.map +1 -1
- package/lib/cells/MaterialIntegerCell.d.ts +1 -1
- package/lib/cells/MaterialIntegerCell.js +3 -1
- package/lib/cells/MaterialIntegerCell.js.map +1 -1
- package/lib/cells/MaterialNumberCell.d.ts +1 -1
- package/lib/cells/MaterialNumberCell.js +3 -1
- package/lib/cells/MaterialNumberCell.js.map +1 -1
- package/lib/cells/MaterialNumberFormatCell.d.ts +1 -1
- package/lib/cells/MaterialNumberFormatCell.js +3 -1
- package/lib/cells/MaterialNumberFormatCell.js.map +1 -1
- package/lib/cells/MaterialOneOfEnumCell.d.ts +10 -0
- package/lib/cells/MaterialOneOfEnumCell.js +41 -0
- package/lib/cells/MaterialOneOfEnumCell.js.map +1 -0
- package/lib/cells/MaterialTextCell.d.ts +1 -1
- package/lib/cells/MaterialTextCell.js +3 -1
- package/lib/cells/MaterialTextCell.js.map +1 -1
- package/lib/cells/MaterialTimeCell.d.ts +1 -1
- package/lib/cells/MaterialTimeCell.js +3 -1
- package/lib/cells/MaterialTimeCell.js.map +1 -1
- package/lib/cells/index.d.ts +2 -1
- package/lib/cells/index.js +13 -9
- package/lib/cells/index.js.map +1 -1
- package/lib/complex/CombinatorProperties.js +4 -2
- package/lib/complex/CombinatorProperties.js.map +1 -1
- package/lib/complex/DeleteDialog.js +1 -0
- package/lib/complex/DeleteDialog.js.map +1 -1
- package/lib/complex/MaterialAllOfRenderer.d.ts +3 -2
- package/lib/complex/MaterialAllOfRenderer.js +5 -3
- package/lib/complex/MaterialAllOfRenderer.js.map +1 -1
- package/lib/complex/MaterialAnyOfRenderer.d.ts +3 -2
- package/lib/complex/MaterialAnyOfRenderer.js +4 -2
- package/lib/complex/MaterialAnyOfRenderer.js.map +1 -1
- package/lib/complex/MaterialArrayControlRenderer.d.ts +1 -1
- package/lib/complex/MaterialArrayControlRenderer.js +3 -1
- package/lib/complex/MaterialArrayControlRenderer.js.map +1 -1
- package/lib/complex/MaterialEnumArrayRenderer.d.ts +2 -2
- package/lib/complex/MaterialEnumArrayRenderer.js +6 -3
- package/lib/complex/MaterialEnumArrayRenderer.js.map +1 -1
- package/lib/complex/MaterialObjectRenderer.d.ts +3 -2
- package/lib/complex/MaterialObjectRenderer.js +5 -3
- package/lib/complex/MaterialObjectRenderer.js.map +1 -1
- package/lib/complex/MaterialOneOfRenderer.d.ts +2 -1
- package/lib/complex/MaterialOneOfRenderer.js +6 -5
- package/lib/complex/MaterialOneOfRenderer.js.map +1 -1
- package/lib/complex/MaterialTableControl.d.ts +16 -1
- package/lib/complex/MaterialTableControl.js +16 -8
- package/lib/complex/MaterialTableControl.js.map +1 -1
- package/lib/complex/NoBorderTableCell.js.map +1 -1
- package/lib/complex/TableToolbar.d.ts +2 -2
- package/lib/complex/TableToolbar.js.map +1 -1
- package/lib/complex/ValidationIcon.d.ts +5 -3
- package/lib/complex/ValidationIcon.js.map +1 -1
- package/lib/complex/index.js +6 -5
- package/lib/complex/index.js.map +1 -1
- package/lib/controls/MaterialAnyOfStringOrEnumControl.d.ts +1 -1
- package/lib/controls/MaterialAnyOfStringOrEnumControl.js +17 -12
- package/lib/controls/MaterialAnyOfStringOrEnumControl.js.map +1 -1
- package/lib/controls/MaterialBooleanControl.d.ts +1 -1
- package/lib/controls/MaterialBooleanControl.js +3 -1
- package/lib/controls/MaterialBooleanControl.js.map +1 -1
- package/lib/controls/MaterialBooleanToggleControl.d.ts +1 -1
- package/lib/controls/MaterialBooleanToggleControl.js +3 -1
- package/lib/controls/MaterialBooleanToggleControl.js.map +1 -1
- package/lib/controls/MaterialDateControl.d.ts +3 -15
- package/lib/controls/MaterialDateControl.js +27 -45
- package/lib/controls/MaterialDateControl.js.map +1 -1
- package/lib/controls/MaterialDateTimeControl.d.ts +3 -6
- package/lib/controls/MaterialDateTimeControl.js +27 -24
- package/lib/controls/MaterialDateTimeControl.js.map +1 -1
- package/lib/controls/MaterialEnumControl.d.ts +1 -1
- package/lib/controls/MaterialEnumControl.js +3 -1
- package/lib/controls/MaterialEnumControl.js.map +1 -1
- package/lib/controls/MaterialInputControl.d.ts +2 -5
- package/lib/controls/MaterialInputControl.js +23 -28
- package/lib/controls/MaterialInputControl.js.map +1 -1
- package/lib/controls/MaterialIntegerControl.d.ts +1 -1
- package/lib/controls/MaterialIntegerControl.js +3 -1
- package/lib/controls/MaterialIntegerControl.js.map +1 -1
- package/lib/controls/MaterialNativeControl.d.ts +3 -6
- package/lib/controls/MaterialNativeControl.js +15 -18
- package/lib/controls/MaterialNativeControl.js.map +1 -1
- package/lib/controls/MaterialNumberControl.d.ts +1 -1
- package/lib/controls/MaterialNumberControl.js +3 -1
- package/lib/controls/MaterialNumberControl.js.map +1 -1
- package/lib/controls/MaterialOneOfEnumControl.d.ts +1 -1
- package/lib/controls/MaterialOneOfEnumControl.js +3 -1
- package/lib/controls/MaterialOneOfEnumControl.js.map +1 -1
- package/lib/controls/MaterialOneOfRadioGroupControl.d.ts +1 -1
- package/lib/controls/MaterialOneOfRadioGroupControl.js +3 -1
- package/lib/controls/MaterialOneOfRadioGroupControl.js.map +1 -1
- package/lib/controls/MaterialRadioGroup.d.ts +2 -5
- package/lib/controls/MaterialRadioGroup.js +15 -20
- package/lib/controls/MaterialRadioGroup.js.map +1 -1
- package/lib/controls/MaterialRadioGroupControl.d.ts +1 -1
- package/lib/controls/MaterialRadioGroupControl.js +3 -1
- package/lib/controls/MaterialRadioGroupControl.js.map +1 -1
- package/lib/controls/MaterialSliderControl.d.ts +3 -6
- package/lib/controls/MaterialSliderControl.js +35 -39
- package/lib/controls/MaterialSliderControl.js.map +1 -1
- package/lib/controls/MaterialTextControl.d.ts +1 -1
- package/lib/controls/MaterialTextControl.js +3 -1
- package/lib/controls/MaterialTextControl.js.map +1 -1
- package/lib/controls/MaterialTimeControl.d.ts +6 -0
- package/lib/controls/MaterialTimeControl.js +62 -0
- package/lib/controls/MaterialTimeControl.js.map +1 -0
- package/lib/controls/index.d.ts +11 -9
- package/lib/controls/index.js +19 -14
- package/lib/controls/index.js.map +1 -1
- package/lib/extended/MaterialAutocompleteEnumControl.d.ts +1 -1
- package/lib/extended/MaterialAutocompleteEnumControl.js +3 -1
- package/lib/extended/MaterialAutocompleteEnumControl.js.map +1 -1
- package/lib/extended/MaterialAutocompleteOneOfEnumControl.d.ts +1 -1
- package/lib/extended/MaterialAutocompleteOneOfEnumControl.js +3 -1
- package/lib/extended/MaterialAutocompleteOneOfEnumControl.js.map +1 -1
- package/lib/extended/MuiAutocomplete.d.ts +2 -2
- package/lib/extended/MuiAutocomplete.js +4 -3
- package/lib/extended/MuiAutocomplete.js.map +1 -1
- package/lib/extended/index.d.ts +2 -2
- package/lib/extended/index.js +2 -1
- package/lib/extended/index.js.map +1 -1
- package/lib/index.js +3 -0
- package/lib/index.js.map +1 -1
- package/lib/jsonforms-material.js +9 -281
- package/lib/jsonforms-material.js.map +1 -1
- package/lib/layouts/ArrayToolbar.js +1 -0
- package/lib/layouts/ArrayToolbar.js.map +1 -1
- package/lib/layouts/ExpandPanelRenderer.d.ts +2 -3
- package/lib/layouts/ExpandPanelRenderer.js +29 -22
- package/lib/layouts/ExpandPanelRenderer.js.map +1 -1
- package/lib/layouts/MaterialArrayLayout.d.ts +1 -11
- package/lib/layouts/MaterialArrayLayout.js +19 -31
- package/lib/layouts/MaterialArrayLayout.js.map +1 -1
- package/lib/layouts/MaterialArrayLayoutRenderer.d.ts +1 -1
- package/lib/layouts/MaterialArrayLayoutRenderer.js +3 -1
- package/lib/layouts/MaterialArrayLayoutRenderer.js.map +1 -1
- package/lib/layouts/MaterialCategorizationLayout.d.ts +2 -10
- package/lib/layouts/MaterialCategorizationLayout.js +31 -47
- package/lib/layouts/MaterialCategorizationLayout.js.map +1 -1
- package/lib/layouts/MaterialCategorizationStepperLayout.d.ts +2 -9
- package/lib/layouts/MaterialCategorizationStepperLayout.js +42 -53
- package/lib/layouts/MaterialCategorizationStepperLayout.js.map +1 -1
- package/lib/layouts/MaterialGroupLayout.d.ts +1 -1
- package/lib/layouts/MaterialGroupLayout.js +3 -1
- package/lib/layouts/MaterialGroupLayout.js.map +1 -1
- package/lib/layouts/MaterialHorizontalLayout.d.ts +1 -1
- package/lib/layouts/MaterialHorizontalLayout.js +3 -1
- package/lib/layouts/MaterialHorizontalLayout.js.map +1 -1
- package/lib/layouts/MaterialVerticalLayout.d.ts +1 -1
- package/lib/layouts/MaterialVerticalLayout.js +3 -1
- package/lib/layouts/MaterialVerticalLayout.js.map +1 -1
- package/lib/layouts/index.js +6 -5
- package/lib/layouts/index.js.map +1 -1
- package/lib/mui-controls/MuiCheckbox.js +2 -2
- package/lib/mui-controls/MuiCheckbox.js.map +1 -1
- package/lib/mui-controls/MuiInputInteger.js +9 -6
- package/lib/mui-controls/MuiInputInteger.js.map +1 -1
- package/lib/mui-controls/MuiInputNumber.js +9 -6
- package/lib/mui-controls/MuiInputNumber.js.map +1 -1
- package/lib/mui-controls/MuiInputNumberFormat.js +7 -8
- package/lib/mui-controls/MuiInputNumberFormat.js.map +1 -1
- package/lib/mui-controls/MuiInputText.js +11 -7
- package/lib/mui-controls/MuiInputText.js.map +1 -1
- package/lib/mui-controls/MuiInputTime.js +5 -3
- package/lib/mui-controls/MuiInputTime.js.map +1 -1
- package/lib/mui-controls/MuiSelect.js +3 -3
- package/lib/mui-controls/MuiSelect.js.map +1 -1
- package/lib/mui-controls/MuiToggle.js +2 -2
- package/lib/mui-controls/MuiToggle.js.map +1 -1
- package/lib/util/datejs.d.ts +3 -0
- package/lib/util/datejs.js +29 -0
- package/lib/util/datejs.js.map +1 -0
- package/lib/util/debounce.d.ts +1 -0
- package/lib/util/debounce.js +48 -0
- package/lib/util/debounce.js.map +1 -0
- package/lib/util/focus.d.ts +1 -0
- package/lib/util/focus.js +36 -0
- package/lib/util/focus.js.map +1 -0
- package/lib/util/index.d.ts +3 -0
- package/lib/util/index.js +4 -0
- package/lib/util/index.js.map +1 -1
- package/lib/util/layout.d.ts +2 -1
- package/lib/util/layout.js +9 -5
- package/lib/util/layout.js.map +1 -1
- package/package.json +12 -13
- package/src/additional/MaterialListWithDetailRenderer.tsx +3 -4
- package/src/cells/CustomizableCells.ts +1 -0
- package/src/cells/MaterialOneOfEnumCell.tsx +46 -0
- package/src/cells/MaterialTimeCell.tsx +1 -0
- package/src/cells/index.ts +5 -0
- package/src/complex/CombinatorProperties.tsx +2 -2
- package/src/complex/MaterialAllOfRenderer.tsx +5 -4
- package/src/complex/MaterialAnyOfRenderer.tsx +4 -3
- package/src/complex/MaterialEnumArrayRenderer.tsx +1 -0
- package/src/complex/MaterialObjectRenderer.tsx +5 -5
- package/src/complex/MaterialOneOfRenderer.tsx +8 -8
- package/src/complex/MaterialTableControl.tsx +36 -24
- package/src/complex/TableToolbar.tsx +1 -2
- package/src/controls/MaterialAnyOfStringOrEnumControl.tsx +16 -12
- package/src/controls/MaterialDateControl.tsx +82 -113
- package/src/controls/MaterialDateTimeControl.tsx +88 -70
- package/src/controls/MaterialInputControl.tsx +62 -70
- package/src/controls/MaterialNativeControl.tsx +54 -58
- package/src/controls/MaterialRadioGroup.tsx +67 -70
- package/src/controls/MaterialSliderControl.tsx +92 -88
- package/src/controls/MaterialTimeControl.tsx +128 -0
- package/src/controls/index.ts +7 -0
- package/src/extended/MuiAutocomplete.tsx +2 -3
- package/src/index.ts +6 -0
- package/src/layouts/ExpandPanelRenderer.tsx +32 -32
- package/src/layouts/MaterialArrayLayout.tsx +73 -83
- package/src/layouts/MaterialCategorizationLayout.tsx +49 -65
- package/src/layouts/MaterialCategorizationStepperLayout.tsx +79 -87
- package/src/mui-controls/MuiCheckbox.tsx +1 -2
- package/src/mui-controls/MuiInputInteger.tsx +12 -9
- package/src/mui-controls/MuiInputNumber.tsx +9 -6
- package/src/mui-controls/MuiInputNumberFormat.tsx +8 -11
- package/src/mui-controls/MuiInputText.tsx +17 -15
- package/src/mui-controls/MuiInputTime.tsx +6 -4
- package/src/mui-controls/MuiSelect.tsx +2 -3
- package/src/mui-controls/MuiToggle.tsx +1 -2
- package/src/util/datejs.ts +32 -0
- package/src/util/debounce.ts +43 -0
- package/src/util/focus.ts +32 -0
- package/src/util/index.ts +3 -0
- package/src/util/layout.tsx +6 -7
- package/test/renderers/MaterialAnyOfRenderer.test.tsx +14 -8
- package/test/renderers/MaterialArrayLayout.test.tsx +8 -8
- package/test/renderers/MaterialBooleanToggleControl.test.tsx +0 -1
- package/test/renderers/MaterialCategorizationLayout.test.tsx +73 -0
- package/test/renderers/MaterialCategorizationStepperLayout.test.tsx +73 -0
- package/test/renderers/MaterialDateControl.test.tsx +42 -0
- package/test/renderers/MaterialDateTimeControl.test.tsx +54 -11
- package/test/renderers/MaterialInputControl.test.tsx +3 -3
- package/test/renderers/MaterialIntegerCell.test.tsx +41 -20
- package/test/renderers/MaterialNumberCell.test.tsx +45 -24
- package/test/renderers/MaterialOneOfEnumCell.test.tsx +93 -0
- package/test/renderers/MaterialOneOfRenderer.test.tsx +10 -7
- package/test/renderers/MaterialTextCell.test.tsx +41 -20
- package/test/renderers/MaterialTimeCell.test.tsx +41 -20
- package/test/renderers/MaterialTimeControl.test.tsx +378 -0
- package/docs/classes/materialarraylayout.html +0 -777
- package/docs/classes/materialcategorizationlayoutrenderer.html +0 -786
- package/docs/classes/materialcategorizationstepperlayoutrenderer.html +0 -762
- package/docs/classes/materialdatecontrol.html +0 -825
- package/docs/classes/materialdatetimecontrol.html +0 -825
- package/docs/classes/materialinputcontrol.html +0 -825
- package/docs/classes/materialnativecontrol.html +0 -825
- package/docs/classes/materialradiogroup.html +0 -825
- package/docs/classes/materialslidercontrol.html +0 -825
- package/docs/interfaces/datecontrol.html +0 -157
- package/docs/interfaces/materialarraylayoutstate.html +0 -157
- package/docs/interfaces/statepropsofdatecontrol.html +0 -468
|
@@ -62,7 +62,7 @@ describe('Material anyOf renderer', () => {
|
|
|
62
62
|
|
|
63
63
|
afterEach(() => wrapper.unmount());
|
|
64
64
|
|
|
65
|
-
it('should add an item at correct path', () => {
|
|
65
|
+
it('should add an item at correct path', (done) => {
|
|
66
66
|
const schema = {
|
|
67
67
|
type: 'object',
|
|
68
68
|
properties: {
|
|
@@ -103,9 +103,12 @@ describe('Material anyOf renderer', () => {
|
|
|
103
103
|
const input = wrapper.find('input').first();
|
|
104
104
|
input.simulate('change', { target: { value: 'test' } });
|
|
105
105
|
wrapper.update();
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
setTimeout(() => {
|
|
107
|
+
expect(onChangeData.data).toEqual({
|
|
108
|
+
value: 'test'
|
|
109
|
+
});
|
|
110
|
+
done();
|
|
111
|
+
}, 1000);
|
|
109
112
|
});
|
|
110
113
|
|
|
111
114
|
it('should add a "mything"', async () => {
|
|
@@ -179,7 +182,7 @@ describe('Material anyOf renderer', () => {
|
|
|
179
182
|
expect(nrOfRowsAfterAdd.length).toBe(4);
|
|
180
183
|
});
|
|
181
184
|
|
|
182
|
-
it('should switch to "yourThing" edit, then switch back, then edit', async () => {
|
|
185
|
+
it('should switch to "yourThing" edit, then switch back, then edit', async (done) => {
|
|
183
186
|
const schema = {
|
|
184
187
|
type: 'object',
|
|
185
188
|
properties: {
|
|
@@ -260,9 +263,12 @@ describe('Material anyOf renderer', () => {
|
|
|
260
263
|
input.simulate('change', { target: { value: 'test' } });
|
|
261
264
|
wrapper.update();
|
|
262
265
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
+
setTimeout(() => {
|
|
267
|
+
expect(onChangeData.data).toEqual({
|
|
268
|
+
myThingsAndOrYourThings: [{ age: 5, name: 'test' }]
|
|
269
|
+
});
|
|
270
|
+
done();
|
|
271
|
+
}, 1000);
|
|
266
272
|
});
|
|
267
273
|
|
|
268
274
|
it('should be hideable', () => {
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
import Enzyme, { mount, ReactWrapper } from 'enzyme';
|
|
37
37
|
import Adapter from 'enzyme-adapter-react-16';
|
|
38
38
|
import { JsonForms, JsonFormsStateProvider } from '@jsonforms/react';
|
|
39
|
-
import {
|
|
39
|
+
import { Accordion } from '@material-ui/core';
|
|
40
40
|
import { initCore } from './util';
|
|
41
41
|
|
|
42
42
|
Enzyme.configure({ adapter: new Adapter() });
|
|
@@ -292,7 +292,7 @@ describe('Material array layout', () => {
|
|
|
292
292
|
// up button
|
|
293
293
|
expect(
|
|
294
294
|
wrapper
|
|
295
|
-
.find('
|
|
295
|
+
.find('Memo(ExpandPanelRendererComponent)')
|
|
296
296
|
.at(0)
|
|
297
297
|
.find('button')
|
|
298
298
|
.find({ 'aria-label': 'Move up' }).length
|
|
@@ -300,7 +300,7 @@ describe('Material array layout', () => {
|
|
|
300
300
|
// down button
|
|
301
301
|
expect(
|
|
302
302
|
wrapper
|
|
303
|
-
.find('
|
|
303
|
+
.find('Memo(ExpandPanelRendererComponent)')
|
|
304
304
|
.at(0)
|
|
305
305
|
.find('button')
|
|
306
306
|
.find({ 'aria-label': 'Move down' }).length
|
|
@@ -326,7 +326,7 @@ describe('Material array layout', () => {
|
|
|
326
326
|
|
|
327
327
|
// getting up button of second item in expension panel;
|
|
328
328
|
const upButton = wrapper
|
|
329
|
-
.find('
|
|
329
|
+
.find('Memo(ExpandPanelRendererComponent)')
|
|
330
330
|
.at(1)
|
|
331
331
|
.find('button')
|
|
332
332
|
.find({ 'aria-label': 'Move up' });
|
|
@@ -363,7 +363,7 @@ describe('Material array layout', () => {
|
|
|
363
363
|
|
|
364
364
|
// getting up button of second item in expension panel;
|
|
365
365
|
const upButton = wrapper
|
|
366
|
-
.find('
|
|
366
|
+
.find('Memo(ExpandPanelRendererComponent)')
|
|
367
367
|
.at(0)
|
|
368
368
|
.find('button')
|
|
369
369
|
.find({ 'aria-label': 'Move down' });
|
|
@@ -394,7 +394,7 @@ describe('Material array layout', () => {
|
|
|
394
394
|
|
|
395
395
|
// getting up button of second item in expension panel;
|
|
396
396
|
const upButton = wrapper
|
|
397
|
-
.find('
|
|
397
|
+
.find('Memo(ExpandPanelRendererComponent)')
|
|
398
398
|
.at(0)
|
|
399
399
|
.find('button')
|
|
400
400
|
.find({ 'aria-label': 'Move up' });
|
|
@@ -414,7 +414,7 @@ describe('Material array layout', () => {
|
|
|
414
414
|
|
|
415
415
|
// getting up button of second item in expension panel;
|
|
416
416
|
const downButton = wrapper
|
|
417
|
-
.find('
|
|
417
|
+
.find('Memo(ExpandPanelRendererComponent)')
|
|
418
418
|
.at(1)
|
|
419
419
|
.find('button')
|
|
420
420
|
.find({ 'aria-label': 'Move down' });
|
|
@@ -426,7 +426,7 @@ describe('Material array layout', () => {
|
|
|
426
426
|
.find(
|
|
427
427
|
`#${
|
|
428
428
|
wrapper
|
|
429
|
-
.find(
|
|
429
|
+
.find(Accordion)
|
|
430
430
|
.at(index)
|
|
431
431
|
.props()['aria-labelledby']
|
|
432
432
|
}`
|
|
@@ -244,7 +244,6 @@ describe('Material boolean toggle control', () => {
|
|
|
244
244
|
expect(wrapper.find('.MuiSwitch-thumb')).toHaveLength(1);
|
|
245
245
|
|
|
246
246
|
const input = wrapper.find('input').first();
|
|
247
|
-
console.log('should render props', input.props());
|
|
248
247
|
expect(input.props().type).toBe('checkbox');
|
|
249
248
|
expect(input.props().checked).toBeTruthy();
|
|
250
249
|
});
|
|
@@ -372,4 +372,77 @@ describe('Material categorization layout', () => {
|
|
|
372
372
|
const materialArrayLayout = wrapper.find(MaterialLayoutRenderer);
|
|
373
373
|
expect(materialArrayLayout.props().renderers).toHaveLength(0);
|
|
374
374
|
});
|
|
375
|
+
|
|
376
|
+
it('display correct content when hiding a tab', () => {
|
|
377
|
+
const data = { name : 'fo' };
|
|
378
|
+
const condition: SchemaBasedCondition = {
|
|
379
|
+
scope: '#/properties/name',
|
|
380
|
+
schema: { maxLength: 3 }
|
|
381
|
+
};
|
|
382
|
+
const nameControl: ControlElement = {
|
|
383
|
+
type: 'Control',
|
|
384
|
+
scope: '#/properties/name'
|
|
385
|
+
};
|
|
386
|
+
const uischema: Categorization = {
|
|
387
|
+
type: 'Categorization',
|
|
388
|
+
label: '',
|
|
389
|
+
options: {
|
|
390
|
+
showNavButtons: true
|
|
391
|
+
},
|
|
392
|
+
elements: [
|
|
393
|
+
{
|
|
394
|
+
type: 'Category',
|
|
395
|
+
label: 'A',
|
|
396
|
+
elements: undefined
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
type: 'Category',
|
|
400
|
+
label: 'B',
|
|
401
|
+
elements: undefined,
|
|
402
|
+
rule: {
|
|
403
|
+
effect: RuleEffect.SHOW,
|
|
404
|
+
condition: condition
|
|
405
|
+
}
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
type: 'Category',
|
|
409
|
+
label: 'C',
|
|
410
|
+
elements: [nameControl],
|
|
411
|
+
rule: {
|
|
412
|
+
effect: RuleEffect.HIDE,
|
|
413
|
+
condition: condition
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
]
|
|
417
|
+
};
|
|
418
|
+
|
|
419
|
+
const core = initCore(fixture.schema, uischema, data);
|
|
420
|
+
|
|
421
|
+
const wrapper = mount(
|
|
422
|
+
<JsonFormsStateProvider initState={{ renderers: materialRenderers, core }}>
|
|
423
|
+
<MaterialCategorizationLayoutRenderer
|
|
424
|
+
{...layoutDefaultProps}
|
|
425
|
+
schema={fixture.schema}
|
|
426
|
+
uischema={uischema}
|
|
427
|
+
/>
|
|
428
|
+
</JsonFormsStateProvider>
|
|
429
|
+
);
|
|
430
|
+
|
|
431
|
+
wrapper
|
|
432
|
+
.find(Tab)
|
|
433
|
+
.at(1)
|
|
434
|
+
.simulate('click');
|
|
435
|
+
|
|
436
|
+
let isCategoryCshown = wrapper.find('input[type="text"]').length > 0;
|
|
437
|
+
expect(isCategoryCshown).toBe(false);
|
|
438
|
+
|
|
439
|
+
core.data = { ...core.data, name: 'Barr' };
|
|
440
|
+
wrapper.setProps({ initState: { renderers: materialRenderers, core }} );
|
|
441
|
+
wrapper.update();
|
|
442
|
+
|
|
443
|
+
isCategoryCshown = wrapper.find('input[type="text"]').length > 0;
|
|
444
|
+
expect(isCategoryCshown).toBe(true);
|
|
445
|
+
|
|
446
|
+
wrapper.unmount();
|
|
447
|
+
});
|
|
375
448
|
});
|
|
@@ -561,4 +561,77 @@ describe('Material categorization stepper layout', () => {
|
|
|
561
561
|
|
|
562
562
|
wrapper.unmount();
|
|
563
563
|
});
|
|
564
|
+
|
|
565
|
+
it('display correct content when hiding a step', () => {
|
|
566
|
+
const data = { name : 'fo' };
|
|
567
|
+
const condition: SchemaBasedCondition = {
|
|
568
|
+
scope: '#/properties/name',
|
|
569
|
+
schema: { maxLength: 3 }
|
|
570
|
+
};
|
|
571
|
+
const nameControl: ControlElement = {
|
|
572
|
+
type: 'Control',
|
|
573
|
+
scope: '#/properties/name'
|
|
574
|
+
};
|
|
575
|
+
const uischema: Categorization = {
|
|
576
|
+
type: 'Categorization',
|
|
577
|
+
label: '',
|
|
578
|
+
options: {
|
|
579
|
+
showNavButtons: true
|
|
580
|
+
},
|
|
581
|
+
elements: [
|
|
582
|
+
{
|
|
583
|
+
type: 'Category',
|
|
584
|
+
label: 'A',
|
|
585
|
+
elements: undefined
|
|
586
|
+
},
|
|
587
|
+
{
|
|
588
|
+
type: 'Category',
|
|
589
|
+
label: 'B',
|
|
590
|
+
elements: undefined,
|
|
591
|
+
rule: {
|
|
592
|
+
effect: RuleEffect.SHOW,
|
|
593
|
+
condition: condition
|
|
594
|
+
}
|
|
595
|
+
},
|
|
596
|
+
{
|
|
597
|
+
type: 'Category',
|
|
598
|
+
label: 'C',
|
|
599
|
+
elements: [nameControl],
|
|
600
|
+
rule: {
|
|
601
|
+
effect: RuleEffect.HIDE,
|
|
602
|
+
condition: condition
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
]
|
|
606
|
+
};
|
|
607
|
+
|
|
608
|
+
const core = initCore(fixture.schema, uischema, data);
|
|
609
|
+
|
|
610
|
+
const wrapper = mount(
|
|
611
|
+
<JsonFormsStateProvider initState={{ renderers: materialRenderers, core }}>
|
|
612
|
+
<MaterialCategorizationStepperLayoutRenderer
|
|
613
|
+
{...layoutDefaultProps}
|
|
614
|
+
schema={fixture.schema}
|
|
615
|
+
uischema={uischema}
|
|
616
|
+
/>
|
|
617
|
+
</JsonFormsStateProvider>
|
|
618
|
+
);
|
|
619
|
+
|
|
620
|
+
wrapper
|
|
621
|
+
.find(StepButton)
|
|
622
|
+
.at(1)
|
|
623
|
+
.simulate('click');
|
|
624
|
+
|
|
625
|
+
let isCategoryCshown = wrapper.find('input[type="text"]').length > 0;
|
|
626
|
+
expect(isCategoryCshown).toBe(false);
|
|
627
|
+
|
|
628
|
+
core.data = { ...core.data, name: 'Barr' };
|
|
629
|
+
wrapper.setProps({ initState: { renderers: materialRenderers, core }} );
|
|
630
|
+
wrapper.update();
|
|
631
|
+
|
|
632
|
+
isCategoryCshown = wrapper.find('input[type="text"]').length > 0;
|
|
633
|
+
expect(isCategoryCshown).toBe(true);
|
|
634
|
+
|
|
635
|
+
wrapper.unmount();
|
|
636
|
+
});
|
|
564
637
|
});
|
|
@@ -101,6 +101,19 @@ describe('Material date control tester', () => {
|
|
|
101
101
|
}
|
|
102
102
|
})
|
|
103
103
|
).toBe(4);
|
|
104
|
+
expect(
|
|
105
|
+
materialDateControlTester(
|
|
106
|
+
{ ...uischema, options: { format: 'date' } },
|
|
107
|
+
{
|
|
108
|
+
type: 'object',
|
|
109
|
+
properties: {
|
|
110
|
+
foo: {
|
|
111
|
+
type: 'string'
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
)
|
|
116
|
+
).toBe(4);
|
|
104
117
|
});
|
|
105
118
|
});
|
|
106
119
|
|
|
@@ -333,4 +346,33 @@ describe('Material date control', () => {
|
|
|
333
346
|
const inputs = wrapper.find('input');
|
|
334
347
|
expect(inputs.length).toBe(0);
|
|
335
348
|
});
|
|
349
|
+
|
|
350
|
+
it('should support format customizations', () => {
|
|
351
|
+
const core = initCore(schema, uischema, {foo: '06---1980'});
|
|
352
|
+
const onChangeData: any = {
|
|
353
|
+
data: undefined
|
|
354
|
+
};
|
|
355
|
+
wrapper = mount(
|
|
356
|
+
<JsonFormsStateProvider initState={{ renderers: materialRenderers, core }}>
|
|
357
|
+
<TestEmitter
|
|
358
|
+
onChange={({ data }) => {
|
|
359
|
+
onChangeData.data = data;
|
|
360
|
+
}}
|
|
361
|
+
/>
|
|
362
|
+
<MaterialDateControl
|
|
363
|
+
schema={schema}
|
|
364
|
+
uischema={{...uischema, options: {
|
|
365
|
+
dateFormat: 'YYYY/MM',
|
|
366
|
+
dateSaveFormat: 'MM---YYYY'
|
|
367
|
+
}}}
|
|
368
|
+
/>
|
|
369
|
+
</JsonFormsStateProvider>
|
|
370
|
+
);
|
|
371
|
+
|
|
372
|
+
const input = wrapper.find('input').first();
|
|
373
|
+
expect(input.props().value).toBe('1980/06');
|
|
374
|
+
|
|
375
|
+
input.simulate('change', { target: { value: '1961/04' } });
|
|
376
|
+
expect(onChangeData.data.foo).toBe('04---1961');
|
|
377
|
+
});
|
|
336
378
|
});
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
import MaterialDateTimeControl, {
|
|
32
32
|
materialDateTimeControlTester
|
|
33
33
|
} from '../../src/controls/MaterialDateTimeControl';
|
|
34
|
-
import
|
|
34
|
+
import dayjs from 'dayjs';
|
|
35
35
|
import { materialRenderers } from '../../src';
|
|
36
36
|
|
|
37
37
|
import Enzyme, { mount, ReactWrapper } from 'enzyme';
|
|
@@ -41,7 +41,7 @@ import { initCore, TestEmitter } from './util';
|
|
|
41
41
|
|
|
42
42
|
Enzyme.configure({ adapter: new Adapter() });
|
|
43
43
|
|
|
44
|
-
const data = { foo:
|
|
44
|
+
const data = { foo: dayjs('1980-04-04 13:37').format() };
|
|
45
45
|
const schema = {
|
|
46
46
|
type: 'object',
|
|
47
47
|
properties: {
|
|
@@ -102,6 +102,19 @@ describe('Material date time control tester', () => {
|
|
|
102
102
|
}
|
|
103
103
|
})
|
|
104
104
|
).toBe(2);
|
|
105
|
+
expect(
|
|
106
|
+
materialDateTimeControlTester(
|
|
107
|
+
{ ...uischema, options: { format: 'date-time' } },
|
|
108
|
+
{
|
|
109
|
+
type: 'object',
|
|
110
|
+
properties: {
|
|
111
|
+
foo: {
|
|
112
|
+
type: 'string'
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
)
|
|
117
|
+
).toBe(2);
|
|
105
118
|
});
|
|
106
119
|
});
|
|
107
120
|
|
|
@@ -173,7 +186,7 @@ describe('Material date time control', () => {
|
|
|
173
186
|
|
|
174
187
|
const input = wrapper.find('input').first();
|
|
175
188
|
expect(input.props().type).toBe('text');
|
|
176
|
-
expect(input.props().value).toBe('04
|
|
189
|
+
expect(input.props().value).toBe('1980-04-04 13:37');
|
|
177
190
|
});
|
|
178
191
|
|
|
179
192
|
it('should update via event', () => {
|
|
@@ -192,9 +205,9 @@ describe('Material date time control', () => {
|
|
|
192
205
|
</JsonFormsStateProvider>
|
|
193
206
|
);
|
|
194
207
|
const input = wrapper.find('input').first();
|
|
195
|
-
input.simulate('change', { target: { value: '
|
|
208
|
+
input.simulate('change', { target: { value: '1961-12-94 20:15' } });
|
|
196
209
|
expect(onChangeData.data.foo).toBe(
|
|
197
|
-
|
|
210
|
+
dayjs('1961-12-94 20:15').format()
|
|
198
211
|
);
|
|
199
212
|
});
|
|
200
213
|
|
|
@@ -205,11 +218,11 @@ describe('Material date time control', () => {
|
|
|
205
218
|
<MaterialDateTimeControl schema={schema} uischema={uischema} />
|
|
206
219
|
</JsonFormsStateProvider>
|
|
207
220
|
);
|
|
208
|
-
core.data = { ...core.data, foo:
|
|
221
|
+
core.data = { ...core.data, foo: dayjs('1961-12-04 20:15').format() };
|
|
209
222
|
wrapper.setProps({ initState: { renderers: materialRenderers, core }} );
|
|
210
223
|
wrapper.update();
|
|
211
224
|
const input = wrapper.find('input').first();
|
|
212
|
-
expect(input.props().value).toBe('04
|
|
225
|
+
expect(input.props().value).toBe('1961-12-04 20:15');
|
|
213
226
|
});
|
|
214
227
|
|
|
215
228
|
it('should update with null value', () => {
|
|
@@ -251,7 +264,7 @@ describe('Material date time control', () => {
|
|
|
251
264
|
wrapper.setProps({ initState: { renderers: materialRenderers, core }} );
|
|
252
265
|
wrapper.update();
|
|
253
266
|
const input = wrapper.find('input').first();
|
|
254
|
-
expect(input.props().value).toBe('04
|
|
267
|
+
expect(input.props().value).toBe('1980-04-04 13:37');
|
|
255
268
|
});
|
|
256
269
|
|
|
257
270
|
it('should not update with null ref', () => {
|
|
@@ -265,7 +278,7 @@ describe('Material date time control', () => {
|
|
|
265
278
|
wrapper.setProps({ initState: { renderers: materialRenderers, core }} );
|
|
266
279
|
wrapper.update();
|
|
267
280
|
const input = wrapper.find('input').first();
|
|
268
|
-
expect(input.props().value).toBe('04
|
|
281
|
+
expect(input.props().value).toBe('1980-04-04 13:37');
|
|
269
282
|
});
|
|
270
283
|
|
|
271
284
|
it('should not update with undefined ref', () => {
|
|
@@ -279,7 +292,7 @@ describe('Material date time control', () => {
|
|
|
279
292
|
wrapper.setProps({ initState: { renderers: materialRenderers, core }} );
|
|
280
293
|
wrapper.update();
|
|
281
294
|
const input = wrapper.find('input').first();
|
|
282
|
-
expect(input.props().value).toBe('04
|
|
295
|
+
expect(input.props().value).toBe('1980-04-04 13:37');
|
|
283
296
|
});
|
|
284
297
|
|
|
285
298
|
it('can be disabled', () => {
|
|
@@ -320,7 +333,7 @@ describe('Material date time control', () => {
|
|
|
320
333
|
</JsonFormsStateProvider>
|
|
321
334
|
);
|
|
322
335
|
const input = wrapper.find('input').first();
|
|
323
|
-
// there is only input id at the
|
|
336
|
+
// there is only input id at the dayjs
|
|
324
337
|
expect(input.props().id).toBe('#/properties/foo-input');
|
|
325
338
|
});
|
|
326
339
|
|
|
@@ -338,4 +351,34 @@ describe('Material date time control', () => {
|
|
|
338
351
|
const inputs = wrapper.find('input');
|
|
339
352
|
expect(inputs.length).toBe(0);
|
|
340
353
|
});
|
|
354
|
+
|
|
355
|
+
it('should support format customizations', () => {
|
|
356
|
+
const core = initCore(schema, uischema, {foo: dayjs('1980-04-23 13:37').format('YYYY/MM/DD h:mm a')});
|
|
357
|
+
const onChangeData: any = {
|
|
358
|
+
data: undefined
|
|
359
|
+
};
|
|
360
|
+
wrapper = mount(
|
|
361
|
+
<JsonFormsStateProvider initState={{ renderers: materialRenderers, core }}>
|
|
362
|
+
<TestEmitter
|
|
363
|
+
onChange={({ data }) => {
|
|
364
|
+
onChangeData.data = data;
|
|
365
|
+
}}
|
|
366
|
+
/>
|
|
367
|
+
<MaterialDateTimeControl
|
|
368
|
+
schema={schema}
|
|
369
|
+
uischema={{...uischema, options: {
|
|
370
|
+
dateTimeFormat: 'DD-MM-YY hh:mm:a',
|
|
371
|
+
dateTimeSaveFormat: 'YYYY/MM/DD h:mm a',
|
|
372
|
+
ampm: true
|
|
373
|
+
}}}
|
|
374
|
+
/>
|
|
375
|
+
</JsonFormsStateProvider>
|
|
376
|
+
);
|
|
377
|
+
|
|
378
|
+
const input = wrapper.find('input').first();
|
|
379
|
+
expect(input.props().value).toBe('23-04-80 01:37:pm');
|
|
380
|
+
|
|
381
|
+
input.simulate('change', { target: { value: '10-12-05 11:22:am' } });
|
|
382
|
+
expect(onChangeData.data.foo).toBe('2005/12/10 11:22 am');
|
|
383
|
+
});
|
|
341
384
|
});
|
|
@@ -159,7 +159,7 @@ describe('Material input control', () => {
|
|
|
159
159
|
wrapper.setProps({ initState: { renderers: materialRenderers, core }} );
|
|
160
160
|
wrapper.update();
|
|
161
161
|
const validation = wrapper.find('p').first();
|
|
162
|
-
expect(validation.text()).toBe('
|
|
162
|
+
expect(validation.text()).toBe('must be string');
|
|
163
163
|
});
|
|
164
164
|
|
|
165
165
|
it('should display multiple errors', () => {
|
|
@@ -173,7 +173,7 @@ describe('Material input control', () => {
|
|
|
173
173
|
wrapper.setProps({ initState: { renderers: materialRenderers, core }} );
|
|
174
174
|
wrapper.update();
|
|
175
175
|
const validation = wrapper.find('p').first();
|
|
176
|
-
expect(validation.text()).toBe('
|
|
176
|
+
expect(validation.text()).toBe('must be string');
|
|
177
177
|
});
|
|
178
178
|
|
|
179
179
|
it('should not show any errors', () => {
|
|
@@ -283,7 +283,7 @@ describe('Material input control', () => {
|
|
|
283
283
|
</JsonFormsStateProvider>
|
|
284
284
|
);
|
|
285
285
|
const label = wrapper.find('label').first();
|
|
286
|
-
expect(label.text()).toBe('Date Cell*');
|
|
286
|
+
expect(label.text()).toBe('Date Cell *');
|
|
287
287
|
});
|
|
288
288
|
|
|
289
289
|
it('should not display a marker for a non-required prop', () => {
|
|
@@ -175,7 +175,7 @@ describe('Material integer cells', () => {
|
|
|
175
175
|
expect(input.props().value).toBe(0);
|
|
176
176
|
});
|
|
177
177
|
|
|
178
|
-
it('should update via input event', () => {
|
|
178
|
+
it('should update via input event', (done) => {
|
|
179
179
|
const core = initCore(schema, uischema, data);
|
|
180
180
|
const onChangeData: any = {
|
|
181
181
|
data: undefined
|
|
@@ -193,10 +193,13 @@ describe('Material integer cells', () => {
|
|
|
193
193
|
|
|
194
194
|
const input = wrapper.find('input');
|
|
195
195
|
input.simulate('change', { target: { value: 13 } });
|
|
196
|
-
|
|
196
|
+
setTimeout(() => {
|
|
197
|
+
expect(onChangeData.data.foo).toBe(13);
|
|
198
|
+
done();
|
|
199
|
+
}, 1000)
|
|
197
200
|
});
|
|
198
201
|
|
|
199
|
-
it('should update via action', () => {
|
|
202
|
+
it('should update via action', (done) => {
|
|
200
203
|
const core = initCore(schema, uischema, { foo: 13 });
|
|
201
204
|
wrapper = mount(
|
|
202
205
|
<JsonFormsStateProvider initState={{ renderers: materialRenderers, core }}>
|
|
@@ -206,11 +209,14 @@ describe('Material integer cells', () => {
|
|
|
206
209
|
core.data = { ...core.data, foo: 42 };
|
|
207
210
|
wrapper.setProps({ initState: { renderers: materialRenderers, core }} );
|
|
208
211
|
wrapper.update();
|
|
209
|
-
|
|
210
|
-
|
|
212
|
+
setTimeout(() => {
|
|
213
|
+
const input = wrapper.find('input').first();
|
|
214
|
+
expect(input.props().value).toBe(42);
|
|
215
|
+
done();
|
|
216
|
+
}, 1000);
|
|
211
217
|
});
|
|
212
218
|
|
|
213
|
-
it('should not update with undefined value', () => {
|
|
219
|
+
it('should not update with undefined value', (done) => {
|
|
214
220
|
const core = initCore(schema, uischema, data);
|
|
215
221
|
wrapper = mount(
|
|
216
222
|
<JsonFormsStateProvider initState={{ renderers: materialRenderers, core }}>
|
|
@@ -220,11 +226,14 @@ describe('Material integer cells', () => {
|
|
|
220
226
|
core.data = { ...core.data, foo: undefined };
|
|
221
227
|
wrapper.setProps({ initState: { renderers: materialRenderers, core }} );
|
|
222
228
|
wrapper.update();
|
|
223
|
-
|
|
224
|
-
|
|
229
|
+
setTimeout(() => {
|
|
230
|
+
const input = wrapper.find('input');
|
|
231
|
+
expect(input.props().value).toBe('');
|
|
232
|
+
done();
|
|
233
|
+
}, 1000);
|
|
225
234
|
});
|
|
226
235
|
|
|
227
|
-
it('should not update with null value', () => {
|
|
236
|
+
it('should not update with null value', (done) => {
|
|
228
237
|
const core = initCore(schema, uischema, data);
|
|
229
238
|
wrapper = mount(
|
|
230
239
|
<JsonFormsStateProvider initState={{ renderers: materialRenderers, core }}>
|
|
@@ -234,11 +243,14 @@ describe('Material integer cells', () => {
|
|
|
234
243
|
core.data = { ...core.data, foo: null };
|
|
235
244
|
wrapper.setProps({ initState: { renderers: materialRenderers, core }} );
|
|
236
245
|
wrapper.update();
|
|
237
|
-
|
|
238
|
-
|
|
246
|
+
setTimeout(() => {
|
|
247
|
+
const input = wrapper.find('input').first();
|
|
248
|
+
expect(input.props().value).toBe('');
|
|
249
|
+
done();
|
|
250
|
+
}, 1000);
|
|
239
251
|
});
|
|
240
252
|
|
|
241
|
-
it('should not update with wrong ref', () => {
|
|
253
|
+
it('should not update with wrong ref', (done) => {
|
|
242
254
|
const core = initCore(schema, uischema, data);
|
|
243
255
|
wrapper = mount(
|
|
244
256
|
<JsonFormsStateProvider initState={{ renderers: materialRenderers, core }}>
|
|
@@ -248,11 +260,14 @@ describe('Material integer cells', () => {
|
|
|
248
260
|
core.data = { ...core.data, bar: 11 };
|
|
249
261
|
wrapper.setProps({ initState: { renderers: materialRenderers, core }} );
|
|
250
262
|
wrapper.update();
|
|
251
|
-
|
|
252
|
-
|
|
263
|
+
setTimeout(() => {
|
|
264
|
+
const input = wrapper.find('input');
|
|
265
|
+
expect(input.props().value).toBe(42);
|
|
266
|
+
done();
|
|
267
|
+
}, 1000);
|
|
253
268
|
});
|
|
254
269
|
|
|
255
|
-
it('should not update with null ref', () => {
|
|
270
|
+
it('should not update with null ref', (done) => {
|
|
256
271
|
const core = initCore(schema, uischema, data);
|
|
257
272
|
wrapper = mount(
|
|
258
273
|
<JsonFormsStateProvider initState={{ renderers: materialRenderers, core }}>
|
|
@@ -262,11 +277,14 @@ describe('Material integer cells', () => {
|
|
|
262
277
|
core.data = { ...core.data, null: 13 };
|
|
263
278
|
wrapper.setProps({ initState: { renderers: materialRenderers, core }} );
|
|
264
279
|
wrapper.update();
|
|
265
|
-
|
|
266
|
-
|
|
280
|
+
setTimeout(() => {
|
|
281
|
+
const input = wrapper.find('input');
|
|
282
|
+
expect(input.props().value).toBe(42);
|
|
283
|
+
done();
|
|
284
|
+
}, 1000);
|
|
267
285
|
});
|
|
268
286
|
|
|
269
|
-
it('should not update with undefined ref', () => {
|
|
287
|
+
it('should not update with undefined ref', (done) => {
|
|
270
288
|
const core = initCore(schema, uischema, data);
|
|
271
289
|
wrapper = mount(
|
|
272
290
|
<JsonFormsStateProvider initState={{ renderers: materialRenderers, core }}>
|
|
@@ -276,8 +294,11 @@ describe('Material integer cells', () => {
|
|
|
276
294
|
core.data = { ...core.data, undefined: 13 };
|
|
277
295
|
wrapper.setProps({ initState: { renderers: materialRenderers, core }} );
|
|
278
296
|
wrapper.update();
|
|
279
|
-
|
|
280
|
-
|
|
297
|
+
setTimeout(() => {
|
|
298
|
+
const input = wrapper.find('input');
|
|
299
|
+
expect(input.props().value).toBe(42);
|
|
300
|
+
done();
|
|
301
|
+
}, 1000);
|
|
281
302
|
});
|
|
282
303
|
|
|
283
304
|
it('can be disabled', () => {
|