@jsonforms/material-renderers 3.0.0-beta.1 → 3.0.0-beta.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.
Files changed (45) hide show
  1. package/docs/globals.html +41 -41
  2. package/docs/interfaces/emptytableprops.html +1 -1
  3. package/docs/interfaces/nonemptycellcomponentprops.html +9 -9
  4. package/docs/interfaces/nonemptycellprops.html +9 -9
  5. package/docs/interfaces/ownoneofprops.html +1 -1
  6. package/docs/interfaces/ownpropsofnonemptycell.html +6 -6
  7. package/docs/interfaces/tableheadercellprops.html +1 -1
  8. package/lib/jsonforms-react-material.cjs.js +12 -21
  9. package/lib/jsonforms-react-material.cjs.js.map +1 -1
  10. package/lib/jsonforms-react-material.esm.js +12 -21
  11. package/lib/jsonforms-react-material.esm.js.map +1 -1
  12. package/package.json +8 -6
  13. package/src/complex/MaterialAllOfRenderer.tsx +3 -5
  14. package/src/complex/MaterialAnyOfRenderer.tsx +3 -5
  15. package/src/complex/MaterialEnumArrayRenderer.tsx +1 -2
  16. package/src/complex/MaterialObjectRenderer.tsx +3 -8
  17. package/src/complex/MaterialOneOfRenderer.tsx +3 -5
  18. package/src/complex/MaterialTableControl.tsx +5 -5
  19. package/stats.html +1 -1
  20. package/test/renderers/MaterialAnyOfStringOrEnumControl.test.tsx +7 -7
  21. package/test/renderers/MaterialArrayLayout.test.tsx +34 -7
  22. package/test/renderers/MaterialBooleanCell.test.tsx +10 -7
  23. package/test/renderers/MaterialBooleanToggleCell.test.tsx +14 -9
  24. package/test/renderers/MaterialBooleanToggleControl.test.tsx +14 -9
  25. package/test/renderers/MaterialCategorizationLayout.test.tsx +12 -12
  26. package/test/renderers/MaterialCategorizationStepperLayout.test.tsx +12 -12
  27. package/test/renderers/MaterialDateCell.test.tsx +10 -7
  28. package/test/renderers/MaterialDateControl.test.tsx +12 -8
  29. package/test/renderers/MaterialDateTimeControl.test.tsx +12 -8
  30. package/test/renderers/MaterialEnumArrayRenderer.test.tsx +9 -7
  31. package/test/renderers/MaterialEnumCell.test.tsx +2 -1
  32. package/test/renderers/MaterialEnumControl.test.tsx +75 -0
  33. package/test/renderers/MaterialIntegerCell.test.tsx +10 -7
  34. package/test/renderers/MaterialLabelRenderer.test.tsx +4 -4
  35. package/test/renderers/MaterialListWithDetailRenderer.test.tsx +5 -5
  36. package/test/renderers/MaterialNumberCell.test.tsx +10 -7
  37. package/test/renderers/MaterialObjectControl.test.tsx +10 -7
  38. package/test/renderers/MaterialOneOfEnumCell.test.tsx +2 -1
  39. package/test/renderers/MaterialOneOfRadioGroupControl.test.tsx +3 -2
  40. package/test/renderers/MaterialOneOfRenderer.test.tsx +12 -7
  41. package/test/renderers/MaterialRadioGroupControl.test.tsx +2 -2
  42. package/test/renderers/MaterialSliderControl.test.tsx +20 -12
  43. package/test/renderers/MaterialTextCell.test.tsx +10 -7
  44. package/test/renderers/MaterialTimeCell.test.tsx +10 -7
  45. package/test/renderers/MaterialTimeControl.test.tsx +12 -8
@@ -0,0 +1,75 @@
1
+ /*
2
+ The MIT License
3
+
4
+ Copyright (c) 2017-2019 EclipseSource Munich
5
+ https://github.com/eclipsesource/jsonforms
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in
15
+ all copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ THE SOFTWARE.
24
+ */
25
+ import './MatchMediaMock';
26
+ import * as React from 'react';
27
+ import {
28
+ ControlElement
29
+ } from '@jsonforms/core';
30
+ import { materialRenderers, MuiSelect } from '../../src';
31
+
32
+ import Enzyme, { mount } from 'enzyme';
33
+ import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
34
+ import { JsonFormsStateProvider } from '@jsonforms/react';
35
+ import { initCore } from './util';
36
+ import { MaterialEnumControl } from '../../src';
37
+
38
+ Enzyme.configure({ adapter: new Adapter() });
39
+
40
+ const data = { nationality: 'JP' };
41
+ const schema = {
42
+ type: 'string',
43
+ enum: ['DE', 'IT', 'JP', 'US', 'RU', 'Other']
44
+ };
45
+ const uischema: ControlElement = {
46
+ type: 'Control',
47
+ scope: '#/properties/nationality',
48
+ options: {
49
+ autocomplete: false
50
+ }
51
+ };
52
+
53
+ describe('Material enum control', () => {
54
+ it('enum options should change when translation changes', () => {
55
+ const core = initCore(schema, uischema, data);
56
+ const translate = () => 'Translated';
57
+ const changedTranslate = () => 'OtherTranslation';
58
+ const wrapper = mount(
59
+ <JsonFormsStateProvider initState={{ renderers: materialRenderers, core, i18n: {translate} }}>
60
+ <MaterialEnumControl
61
+ schema={schema}
62
+ uischema={uischema}
63
+ path='nationality'
64
+ />
65
+ </JsonFormsStateProvider>
66
+ );
67
+
68
+ expect(wrapper.find(MuiSelect).props().options[0].label).toBe('Translated');
69
+
70
+ wrapper.setProps({ initState: { renderers: materialRenderers, core, i18n: {translate: changedTranslate} }} );
71
+ wrapper.update();
72
+
73
+ expect(wrapper.find(MuiSelect).props().options[0].label).toBe('OtherTranslation');
74
+ });
75
+ });
@@ -57,27 +57,29 @@ describe('Material integer cells tester', () => {
57
57
  };
58
58
 
59
59
  it('should fail', () => {
60
- expect(materialIntegerCellTester(undefined, undefined)).toBe(
60
+ expect(materialIntegerCellTester(undefined, undefined, undefined)).toBe(
61
61
  NOT_APPLICABLE
62
62
  );
63
- expect(materialIntegerCellTester(null, undefined)).toBe(NOT_APPLICABLE);
64
- expect(materialIntegerCellTester({ type: 'Foo' }, undefined)).toBe(
63
+ expect(materialIntegerCellTester(null, undefined, undefined)).toBe(NOT_APPLICABLE);
64
+ expect(materialIntegerCellTester({ type: 'Foo' }, undefined, undefined)).toBe(
65
65
  NOT_APPLICABLE
66
66
  );
67
- expect(materialIntegerCellTester({ type: 'Control' }, undefined)).toBe(
67
+ expect(materialIntegerCellTester({ type: 'Control' }, undefined, undefined)).toBe(
68
68
  NOT_APPLICABLE
69
69
  );
70
70
  expect(
71
71
  materialIntegerCellTester(controlElement, {
72
72
  type: 'object',
73
73
  properties: { foo: { type: 'string' } }
74
- })
74
+ },
75
+ undefined)
75
76
  ).toBe(NOT_APPLICABLE);
76
77
  expect(
77
78
  materialIntegerCellTester(controlElement, {
78
79
  type: 'object',
79
80
  properties: { foo: { type: 'string' }, bar: { type: 'integer' } }
80
- })
81
+ },
82
+ undefined)
81
83
  ).toBe(NOT_APPLICABLE);
82
84
  });
83
85
 
@@ -86,7 +88,8 @@ describe('Material integer cells tester', () => {
86
88
  materialIntegerCellTester(controlElement, {
87
89
  type: 'object',
88
90
  properties: { foo: { type: 'integer' } }
89
- })
91
+ },
92
+ undefined)
90
93
  ).toBe(2);
91
94
  });
92
95
  });
@@ -51,14 +51,14 @@ const uischema = {
51
51
 
52
52
  describe('Material Label Renderer tester', () => {
53
53
  it('should fail', () => {
54
- expect(materialLabelRendererTester(undefined, undefined)).toBe(
54
+ expect(materialLabelRendererTester(undefined, undefined, undefined)).toBe(
55
55
  NOT_APPLICABLE
56
56
  );
57
- expect(materialLabelRendererTester(null, undefined)).toBe(NOT_APPLICABLE);
58
- expect(materialLabelRendererTester({ type: 'Foo' }, undefined)).toBe(
57
+ expect(materialLabelRendererTester(null, undefined, undefined)).toBe(NOT_APPLICABLE);
58
+ expect(materialLabelRendererTester({ type: 'Foo' }, undefined, undefined)).toBe(
59
59
  NOT_APPLICABLE
60
60
  );
61
- expect(materialLabelRendererTester({ type: 'Label' }, undefined)).toBe(1);
61
+ expect(materialLabelRendererTester({ type: 'Label' }, undefined, undefined)).toBe(1);
62
62
  });
63
63
  });
64
64
 
@@ -110,13 +110,13 @@ describe('Material list with detail tester', () => {
110
110
  type: 'string'
111
111
  }
112
112
  };
113
- expect(materialListWithDetailTester(uischema, schema)).toBe(-1);
114
- expect(materialListWithDetailTester(correctUISchema, wrongSchema)).toBe(-1);
115
- expect(materialListWithDetailTester(correctUISchema, schema)).toBe(4);
116
- expect(materialListWithDetailTester(correctUISchema, nestedSchema)).toBe(
113
+ expect(materialListWithDetailTester(uischema, schema, undefined)).toBe(-1);
114
+ expect(materialListWithDetailTester(correctUISchema, wrongSchema, undefined)).toBe(-1);
115
+ expect(materialListWithDetailTester(correctUISchema, schema, undefined)).toBe(4);
116
+ expect(materialListWithDetailTester(correctUISchema, nestedSchema, undefined)).toBe(
117
117
  -1
118
118
  );
119
- expect(materialListWithDetailTester(correctUISchema, nestedSchema2)).toBe(
119
+ expect(materialListWithDetailTester(correctUISchema, nestedSchema2, undefined)).toBe(
120
120
  4
121
121
  );
122
122
  });
@@ -52,12 +52,12 @@ const uischema: ControlElement = {
52
52
 
53
53
  describe('Material number cells tester', () => {
54
54
  it('should fail', () => {
55
- expect(materialNumberCellTester(undefined, undefined)).toBe(NOT_APPLICABLE);
56
- expect(materialNumberCellTester(null, undefined)).toBe(NOT_APPLICABLE);
57
- expect(materialNumberCellTester({ type: 'Foo' }, undefined)).toBe(
55
+ expect(materialNumberCellTester(undefined, undefined, undefined)).toBe(NOT_APPLICABLE);
56
+ expect(materialNumberCellTester(null, undefined, undefined)).toBe(NOT_APPLICABLE);
57
+ expect(materialNumberCellTester({ type: 'Foo' }, undefined, undefined)).toBe(
58
58
  NOT_APPLICABLE
59
59
  );
60
- expect(materialNumberCellTester({ type: 'Control' }, undefined)).toBe(
60
+ expect(materialNumberCellTester({ type: 'Control' }, undefined, undefined)).toBe(
61
61
  NOT_APPLICABLE
62
62
  );
63
63
  });
@@ -75,7 +75,8 @@ describe('Material number cells tester', () => {
75
75
  type: 'string'
76
76
  }
77
77
  }
78
- })
78
+ },
79
+ undefined)
79
80
  ).toBe(NOT_APPLICABLE);
80
81
  });
81
82
 
@@ -95,7 +96,8 @@ describe('Material number cells tester', () => {
95
96
  type: 'number'
96
97
  }
97
98
  }
98
- })
99
+ },
100
+ undefined)
99
101
  ).toBe(NOT_APPLICABLE);
100
102
  });
101
103
 
@@ -112,7 +114,8 @@ describe('Material number cells tester', () => {
112
114
  type: 'number'
113
115
  }
114
116
  }
115
- })
117
+ },
118
+ undefined)
116
119
  ).toBe(2);
117
120
  });
118
121
  });
@@ -68,14 +68,14 @@ const uischema2: ControlElement = {
68
68
 
69
69
  describe('Material object renderer tester', () => {
70
70
  test('should fail', () => {
71
- expect(materialObjectControlTester(undefined, undefined)).toBe(
71
+ expect(materialObjectControlTester(undefined, undefined, undefined)).toBe(
72
72
  NOT_APPLICABLE
73
73
  );
74
- expect(materialObjectControlTester(null, undefined)).toBe(NOT_APPLICABLE);
75
- expect(materialObjectControlTester({ type: 'Foo' }, undefined)).toBe(
74
+ expect(materialObjectControlTester(null, undefined, undefined)).toBe(NOT_APPLICABLE);
75
+ expect(materialObjectControlTester({ type: 'Foo' }, undefined, undefined)).toBe(
76
76
  NOT_APPLICABLE
77
77
  );
78
- expect(materialObjectControlTester({ type: 'Control' }, undefined)).toBe(
78
+ expect(materialObjectControlTester({ type: 'Control' }, undefined, undefined)).toBe(
79
79
  NOT_APPLICABLE
80
80
  );
81
81
  expect(
@@ -84,7 +84,8 @@ describe('Material object renderer tester', () => {
84
84
  properties: {
85
85
  foo: { type: 'string' }
86
86
  }
87
- })
87
+ },
88
+ undefined)
88
89
  ).toBe(NOT_APPLICABLE);
89
90
  expect(
90
91
  materialObjectControlTester(uischema2, {
@@ -93,7 +94,8 @@ describe('Material object renderer tester', () => {
93
94
  foo: { type: 'string' },
94
95
  bar: schema.properties.bar
95
96
  }
96
- })
97
+ },
98
+ undefined)
97
99
  ).toBe(NOT_APPLICABLE);
98
100
  });
99
101
 
@@ -104,7 +106,8 @@ describe('Material object renderer tester', () => {
104
106
  properties: {
105
107
  foo: schema.properties.foo
106
108
  }
107
- })
109
+ },
110
+ undefined)
108
111
  ).toBe(2);
109
112
  });
110
113
  });
@@ -70,7 +70,8 @@ describe('Material one of enum cell tester', () => {
70
70
  properties: {
71
71
  country: schema
72
72
  }
73
- })
73
+ },
74
+ undefined)
74
75
  ).toBe(2);
75
76
  });
76
77
  });
@@ -63,7 +63,7 @@ const uischema: ControlElement = {
63
63
 
64
64
  describe('Material oneof radio group tester', () => {
65
65
  it('should return valid rank for oneof enums with radio format', () => {
66
- const rank = materialOneOfRadioGroupControlTester(uischema, oneOfSchema);
66
+ const rank = materialOneOfRadioGroupControlTester(uischema, oneOfSchema, undefined);
67
67
  expect(rank).not.toBe(NOT_APPLICABLE);
68
68
  });
69
69
 
@@ -74,7 +74,8 @@ describe('Material oneof radio group tester', () => {
74
74
  };
75
75
  const rank = materialOneOfRadioGroupControlTester(
76
76
  uiSchemaNoRadio,
77
- oneOfSchema
77
+ oneOfSchema,
78
+ undefined
78
79
  );
79
80
  expect(rank).toBe(NOT_APPLICABLE);
80
81
  });
@@ -309,7 +309,7 @@ describe('Material oneOf renderer', () => {
309
309
  }, 1000);
310
310
  });
311
311
 
312
- it.skip('should add an item within an array', async () => {
312
+ it('should add an item within an array', async () => {
313
313
  const schema = {
314
314
  type: 'object',
315
315
  properties: {
@@ -366,7 +366,7 @@ describe('Material oneOf renderer', () => {
366
366
  expect(nrOfRowsAfterAdd.length).toBe(3);
367
367
  });
368
368
 
369
- it.skip('should add an object within an array', async () => {
369
+ it('should add an object within an array', async () => {
370
370
  const schema = {
371
371
  type: 'object',
372
372
  properties: {
@@ -424,7 +424,6 @@ describe('Material oneOf renderer', () => {
424
424
 
425
425
  await waitForAsync();
426
426
 
427
- // expect(wrapper.state())
428
427
  wrapper.update();
429
428
 
430
429
  selectOneOfTab(wrapper, 1, false);
@@ -441,7 +440,7 @@ describe('Material oneOf renderer', () => {
441
440
  });
442
441
  });
443
442
 
444
- it.skip('should switch to array based oneOf subschema, then switch back, then edit', async () => {
443
+ it('should switch to array based oneOf subschema, then switch back, then edit', async (done) => {
445
444
  const schema = {
446
445
  type: 'object',
447
446
  properties: {
@@ -511,9 +510,15 @@ describe('Material oneOf renderer', () => {
511
510
  const input = wrapper.find('input').first();
512
511
  input.simulate('change', { target: { value: 'test' } });
513
512
  wrapper.update();
514
- expect(onChangeData.data).toEqual({
515
- thingOrThings: { thing: 'test' }
516
- });
513
+
514
+ setTimeout(() => {
515
+ expect(onChangeData.data).toEqual({
516
+ thingOrThings: { thing: 'test' }
517
+ });
518
+ done();
519
+ }, 1000);
520
+
521
+
517
522
  });
518
523
 
519
524
  it('should show confirm dialog when data is not an empty object', async () => {
@@ -56,7 +56,7 @@ const uischema: ControlElement = {
56
56
 
57
57
  describe('Material radio group tester', () => {
58
58
  it('should return valid rank for enums with radio format', () => {
59
- const rank = materialRadioGroupControlTester(uischema, schema);
59
+ const rank = materialRadioGroupControlTester(uischema, schema, undefined);
60
60
  expect(rank).not.toBe(NOT_APPLICABLE);
61
61
  });
62
62
 
@@ -65,7 +65,7 @@ describe('Material radio group tester', () => {
65
65
  type: 'Control',
66
66
  scope: '#/properties/foo'
67
67
  };
68
- const rank = materialRadioGroupControlTester(uiSchemaNoRadio, schema);
68
+ const rank = materialRadioGroupControlTester(uiSchemaNoRadio, schema, undefined);
69
69
  expect(rank).toBe(NOT_APPLICABLE);
70
70
  });
71
71
  });
@@ -64,14 +64,14 @@ const uischema: ControlElement = {
64
64
 
65
65
  describe('Material slider tester', () => {
66
66
  it('should fail', () => {
67
- expect(materialSliderControlTester(undefined, undefined)).toBe(
67
+ expect(materialSliderControlTester(undefined, undefined, undefined)).toBe(
68
68
  NOT_APPLICABLE
69
69
  );
70
- expect(materialSliderControlTester(null, undefined)).toBe(NOT_APPLICABLE);
71
- expect(materialSliderControlTester({ type: 'Foo' }, undefined)).toBe(
70
+ expect(materialSliderControlTester(null, undefined, undefined)).toBe(NOT_APPLICABLE);
71
+ expect(materialSliderControlTester({ type: 'Foo' }, undefined, undefined)).toBe(
72
72
  NOT_APPLICABLE
73
73
  );
74
- expect(materialSliderControlTester({ type: 'Control' }, undefined)).toBe(
74
+ expect(materialSliderControlTester({ type: 'Control' }, undefined, undefined)).toBe(
75
75
  NOT_APPLICABLE
76
76
  );
77
77
  });
@@ -83,7 +83,8 @@ describe('Material slider tester', () => {
83
83
  properties: {
84
84
  foo: { type: 'string' }
85
85
  }
86
- })
86
+ },
87
+ undefined)
87
88
  ).toBe(NOT_APPLICABLE);
88
89
  });
89
90
 
@@ -95,7 +96,8 @@ describe('Material slider tester', () => {
95
96
  foo: { type: 'string' },
96
97
  bar: { type: 'number' }
97
98
  }
98
- })
99
+ },
100
+ undefined)
99
101
  ).toBe(NOT_APPLICABLE);
100
102
  });
101
103
 
@@ -106,7 +108,8 @@ describe('Material slider tester', () => {
106
108
  properties: {
107
109
  foo: { type: 'number' }
108
110
  }
109
- })
111
+ },
112
+ undefined)
110
113
  ).toBe(NOT_APPLICABLE);
111
114
  });
112
115
 
@@ -120,7 +123,8 @@ describe('Material slider tester', () => {
120
123
  minimum: 2
121
124
  }
122
125
  }
123
- })
126
+ },
127
+ undefined)
124
128
  ).toBe(NOT_APPLICABLE);
125
129
  });
126
130
 
@@ -134,7 +138,8 @@ describe('Material slider tester', () => {
134
138
  maximum: 10
135
139
  }
136
140
  }
137
- })
141
+ },
142
+ undefined)
138
143
  ).toBe(NOT_APPLICABLE);
139
144
  });
140
145
 
@@ -149,7 +154,8 @@ describe('Material slider tester', () => {
149
154
  minimum: 2
150
155
  }
151
156
  }
152
- })
157
+ },
158
+ undefined)
153
159
  ).toBe(NOT_APPLICABLE);
154
160
  });
155
161
 
@@ -165,7 +171,8 @@ describe('Material slider tester', () => {
165
171
  default: 6
166
172
  }
167
173
  }
168
- })
174
+ },
175
+ undefined)
169
176
  ).toBe(4);
170
177
  });
171
178
 
@@ -181,7 +188,8 @@ describe('Material slider tester', () => {
181
188
  default: 6
182
189
  }
183
190
  }
184
- })
191
+ },
192
+ undefined)
185
193
  ).toBe(4);
186
194
  });
187
195
  });
@@ -62,12 +62,12 @@ const uischema: ControlElement = {
62
62
 
63
63
  describe('Material text cell tester', () => {
64
64
  it('should fail', () => {
65
- expect(materialTextCellTester(undefined, undefined)).toBe(NOT_APPLICABLE);
66
- expect(materialTextCellTester(null, undefined)).toBe(NOT_APPLICABLE);
67
- expect(materialTextCellTester({ type: 'Foo' }, undefined)).toBe(
65
+ expect(materialTextCellTester(undefined, undefined, undefined)).toBe(NOT_APPLICABLE);
66
+ expect(materialTextCellTester(null, undefined, undefined)).toBe(NOT_APPLICABLE);
67
+ expect(materialTextCellTester({ type: 'Foo' }, undefined, undefined)).toBe(
68
68
  NOT_APPLICABLE
69
69
  );
70
- expect(materialTextCellTester({ type: 'Control' }, undefined)).toBe(
70
+ expect(materialTextCellTester({ type: 'Control' }, undefined, undefined)).toBe(
71
71
  NOT_APPLICABLE
72
72
  );
73
73
  });
@@ -84,7 +84,8 @@ describe('Material text cell tester', () => {
84
84
  type: 'number'
85
85
  }
86
86
  }
87
- })
87
+ },
88
+ undefined)
88
89
  ).toBe(NOT_APPLICABLE);
89
90
  });
90
91
 
@@ -104,7 +105,8 @@ describe('Material text cell tester', () => {
104
105
  type: 'string'
105
106
  }
106
107
  }
107
- })
108
+ },
109
+ undefined)
108
110
  ).toBe(NOT_APPLICABLE);
109
111
  });
110
112
 
@@ -121,7 +123,8 @@ describe('Material text cell tester', () => {
121
123
  type: 'string'
122
124
  }
123
125
  }
124
- })
126
+ },
127
+ undefined)
125
128
  ).toBe(1);
126
129
  });
127
130
  });
@@ -54,12 +54,12 @@ const uischema: ControlElement = {
54
54
 
55
55
  describe('Material time cell tester', () => {
56
56
  it('should fail', () => {
57
- expect(materialTimeCellTester(undefined, undefined)).toBe(NOT_APPLICABLE);
58
- expect(materialTimeCellTester(null, undefined)).toBe(NOT_APPLICABLE);
59
- expect(materialTimeCellTester({ type: 'Foo' }, undefined)).toBe(
57
+ expect(materialTimeCellTester(undefined, undefined, undefined)).toBe(NOT_APPLICABLE);
58
+ expect(materialTimeCellTester(null, undefined, undefined)).toBe(NOT_APPLICABLE);
59
+ expect(materialTimeCellTester({ type: 'Foo' }, undefined, undefined)).toBe(
60
60
  NOT_APPLICABLE
61
61
  );
62
- expect(materialTimeCellTester({ type: 'Control' }, undefined)).toBe(
62
+ expect(materialTimeCellTester({ type: 'Control' }, undefined, undefined)).toBe(
63
63
  NOT_APPLICABLE
64
64
  );
65
65
  });
@@ -71,7 +71,8 @@ describe('Material time cell tester', () => {
71
71
  properties: {
72
72
  foo: { type: 'string' }
73
73
  }
74
- })
74
+ },
75
+ undefined)
75
76
  ).toBe(NOT_APPLICABLE);
76
77
  });
77
78
 
@@ -86,7 +87,8 @@ describe('Material time cell tester', () => {
86
87
  format: 'time'
87
88
  }
88
89
  }
89
- })
90
+ },
91
+ undefined)
90
92
  ).toBe(NOT_APPLICABLE);
91
93
  });
92
94
 
@@ -100,7 +102,8 @@ describe('Material time cell tester', () => {
100
102
  format: 'time'
101
103
  }
102
104
  }
103
- })
105
+ },
106
+ undefined)
104
107
  ).toBe(2);
105
108
  });
106
109
  });
@@ -57,14 +57,14 @@ const uischema: ControlElement = {
57
57
 
58
58
  describe('Material time control tester', () => {
59
59
  test('should fail', () => {
60
- expect(materialTimeControlTester(undefined, undefined)).toBe(
60
+ expect(materialTimeControlTester(undefined, undefined, undefined)).toBe(
61
61
  NOT_APPLICABLE
62
62
  );
63
- expect(materialTimeControlTester(null, undefined)).toBe(NOT_APPLICABLE);
64
- expect(materialTimeControlTester({ type: 'Foo' }, undefined)).toBe(
63
+ expect(materialTimeControlTester(null, undefined, undefined)).toBe(NOT_APPLICABLE);
64
+ expect(materialTimeControlTester({ type: 'Foo' }, undefined, undefined)).toBe(
65
65
  NOT_APPLICABLE
66
66
  );
67
- expect(materialTimeControlTester({ type: 'Control' }, undefined)).toBe(
67
+ expect(materialTimeControlTester({ type: 'Control' }, undefined, undefined)).toBe(
68
68
  NOT_APPLICABLE
69
69
  );
70
70
  expect(
@@ -73,7 +73,8 @@ describe('Material time control tester', () => {
73
73
  properties: {
74
74
  foo: { type: 'string' }
75
75
  }
76
- })
76
+ },
77
+ undefined)
77
78
  ).toBe(NOT_APPLICABLE);
78
79
  expect(
79
80
  materialTimeControlTester(uischema, {
@@ -85,7 +86,8 @@ describe('Material time control tester', () => {
85
86
  format: 'time'
86
87
  }
87
88
  }
88
- })
89
+ },
90
+ undefined)
89
91
  ).toBe(NOT_APPLICABLE);
90
92
  });
91
93
 
@@ -99,7 +101,8 @@ describe('Material time control tester', () => {
99
101
  format: 'time'
100
102
  }
101
103
  }
102
- })
104
+ },
105
+ undefined)
103
106
  ).toBe(4);
104
107
  expect(
105
108
  materialTimeControlTester(
@@ -111,7 +114,8 @@ describe('Material time control tester', () => {
111
114
  type: 'string'
112
115
  }
113
116
  }
114
- }
117
+ },
118
+ undefined
115
119
  )
116
120
  ).toBe(4);
117
121
  });