@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.
- package/docs/globals.html +41 -41
- package/docs/interfaces/emptytableprops.html +1 -1
- package/docs/interfaces/nonemptycellcomponentprops.html +9 -9
- package/docs/interfaces/nonemptycellprops.html +9 -9
- package/docs/interfaces/ownoneofprops.html +1 -1
- package/docs/interfaces/ownpropsofnonemptycell.html +6 -6
- package/docs/interfaces/tableheadercellprops.html +1 -1
- package/lib/jsonforms-react-material.cjs.js +12 -21
- package/lib/jsonforms-react-material.cjs.js.map +1 -1
- package/lib/jsonforms-react-material.esm.js +12 -21
- package/lib/jsonforms-react-material.esm.js.map +1 -1
- package/package.json +8 -6
- package/src/complex/MaterialAllOfRenderer.tsx +3 -5
- package/src/complex/MaterialAnyOfRenderer.tsx +3 -5
- package/src/complex/MaterialEnumArrayRenderer.tsx +1 -2
- package/src/complex/MaterialObjectRenderer.tsx +3 -8
- package/src/complex/MaterialOneOfRenderer.tsx +3 -5
- package/src/complex/MaterialTableControl.tsx +5 -5
- package/stats.html +1 -1
- package/test/renderers/MaterialAnyOfStringOrEnumControl.test.tsx +7 -7
- package/test/renderers/MaterialArrayLayout.test.tsx +34 -7
- package/test/renderers/MaterialBooleanCell.test.tsx +10 -7
- package/test/renderers/MaterialBooleanToggleCell.test.tsx +14 -9
- package/test/renderers/MaterialBooleanToggleControl.test.tsx +14 -9
- package/test/renderers/MaterialCategorizationLayout.test.tsx +12 -12
- package/test/renderers/MaterialCategorizationStepperLayout.test.tsx +12 -12
- package/test/renderers/MaterialDateCell.test.tsx +10 -7
- package/test/renderers/MaterialDateControl.test.tsx +12 -8
- package/test/renderers/MaterialDateTimeControl.test.tsx +12 -8
- package/test/renderers/MaterialEnumArrayRenderer.test.tsx +9 -7
- package/test/renderers/MaterialEnumCell.test.tsx +2 -1
- package/test/renderers/MaterialEnumControl.test.tsx +75 -0
- package/test/renderers/MaterialIntegerCell.test.tsx +10 -7
- package/test/renderers/MaterialLabelRenderer.test.tsx +4 -4
- package/test/renderers/MaterialListWithDetailRenderer.test.tsx +5 -5
- package/test/renderers/MaterialNumberCell.test.tsx +10 -7
- package/test/renderers/MaterialObjectControl.test.tsx +10 -7
- package/test/renderers/MaterialOneOfEnumCell.test.tsx +2 -1
- package/test/renderers/MaterialOneOfRadioGroupControl.test.tsx +3 -2
- package/test/renderers/MaterialOneOfRenderer.test.tsx +12 -7
- package/test/renderers/MaterialRadioGroupControl.test.tsx +2 -2
- package/test/renderers/MaterialSliderControl.test.tsx +20 -12
- package/test/renderers/MaterialTextCell.test.tsx +10 -7
- package/test/renderers/MaterialTimeCell.test.tsx +10 -7
- package/test/renderers/MaterialTimeControl.test.tsx +12 -8
|
@@ -75,6 +75,18 @@ const nestedSchema = {
|
|
|
75
75
|
}
|
|
76
76
|
};
|
|
77
77
|
|
|
78
|
+
const nestedSchemaWithRef = {
|
|
79
|
+
definitions: {
|
|
80
|
+
arrayItems: {
|
|
81
|
+
...schema
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
type: 'array',
|
|
85
|
+
items: {
|
|
86
|
+
$ref: '#/definitions/arrayItems'
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
78
90
|
const uischema: ControlElement = {
|
|
79
91
|
type: 'Control',
|
|
80
92
|
scope: '#'
|
|
@@ -100,6 +112,18 @@ const nestedSchema2 = {
|
|
|
100
112
|
}
|
|
101
113
|
};
|
|
102
114
|
|
|
115
|
+
const nestedSchema2WithRef = {
|
|
116
|
+
definitions: {
|
|
117
|
+
arrayItems: {
|
|
118
|
+
...nestedSchema2
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
type: 'array',
|
|
122
|
+
items: {
|
|
123
|
+
$ref: '#/definitions/arrayItems'
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
103
127
|
const uischemaWithSortOption: ControlElement = {
|
|
104
128
|
type: 'Control',
|
|
105
129
|
scope: '#',
|
|
@@ -154,13 +178,16 @@ const uischemaOptions: {
|
|
|
154
178
|
|
|
155
179
|
describe('Material array layout tester', () => {
|
|
156
180
|
it('should only be applicable for intermediate array or when containing proper options', () => {
|
|
157
|
-
expect(materialArrayLayoutTester(uischema, schema)).toBe(-1);
|
|
158
|
-
expect(materialArrayLayoutTester(uischema, nestedSchema)).toBe(4);
|
|
159
|
-
expect(materialArrayLayoutTester(uischema, nestedSchema2)).toBe(4);
|
|
160
|
-
|
|
161
|
-
expect(materialArrayLayoutTester(
|
|
162
|
-
expect(materialArrayLayoutTester(
|
|
163
|
-
|
|
181
|
+
expect(materialArrayLayoutTester(uischema, schema, undefined)).toBe(-1);
|
|
182
|
+
expect(materialArrayLayoutTester(uischema, nestedSchema, undefined)).toBe(4);
|
|
183
|
+
expect(materialArrayLayoutTester(uischema, nestedSchema2, undefined)).toBe(4);
|
|
184
|
+
expect(materialArrayLayoutTester(uischema, nestedSchemaWithRef, nestedSchemaWithRef)).toBe(4);
|
|
185
|
+
expect(materialArrayLayoutTester(uischema, nestedSchemaWithRef, nestedSchemaWithRef)).toBe(4);
|
|
186
|
+
expect(materialArrayLayoutTester(uischema, nestedSchema2WithRef, nestedSchema2WithRef)).toBe(4);
|
|
187
|
+
|
|
188
|
+
expect(materialArrayLayoutTester(uischemaOptions.default, schema, undefined)).toBe(-1);
|
|
189
|
+
expect(materialArrayLayoutTester(uischemaOptions.generate, schema, undefined)).toBe(4);
|
|
190
|
+
expect(materialArrayLayoutTester(uischemaOptions.inline, schema, undefined)).toBe(4);
|
|
164
191
|
});
|
|
165
192
|
});
|
|
166
193
|
|
|
@@ -57,21 +57,22 @@ describe('Material boolean cell tester', () => {
|
|
|
57
57
|
};
|
|
58
58
|
|
|
59
59
|
it('should fail', () => {
|
|
60
|
-
expect(materialBooleanCellTester(undefined, undefined)).toBe(
|
|
60
|
+
expect(materialBooleanCellTester(undefined, undefined, undefined)).toBe(
|
|
61
61
|
NOT_APPLICABLE
|
|
62
62
|
);
|
|
63
|
-
expect(materialBooleanCellTester(null, undefined)).toBe(NOT_APPLICABLE);
|
|
64
|
-
expect(materialBooleanCellTester({ type: 'Foo' }, undefined)).toBe(
|
|
63
|
+
expect(materialBooleanCellTester(null, undefined, undefined)).toBe(NOT_APPLICABLE);
|
|
64
|
+
expect(materialBooleanCellTester({ type: 'Foo' }, undefined, undefined)).toBe(
|
|
65
65
|
NOT_APPLICABLE
|
|
66
66
|
);
|
|
67
|
-
expect(materialBooleanCellTester({ type: 'Control' }, undefined)).toBe(
|
|
67
|
+
expect(materialBooleanCellTester({ type: 'Control' }, undefined, undefined)).toBe(
|
|
68
68
|
NOT_APPLICABLE
|
|
69
69
|
);
|
|
70
70
|
expect(
|
|
71
71
|
materialBooleanCellTester(control, {
|
|
72
72
|
type: 'object',
|
|
73
73
|
properties: { foo: { type: 'string' } }
|
|
74
|
-
}
|
|
74
|
+
},
|
|
75
|
+
undefined)
|
|
75
76
|
).toBe(NOT_APPLICABLE);
|
|
76
77
|
expect(
|
|
77
78
|
materialBooleanCellTester(control, {
|
|
@@ -84,7 +85,8 @@ describe('Material boolean cell tester', () => {
|
|
|
84
85
|
type: 'boolean'
|
|
85
86
|
}
|
|
86
87
|
}
|
|
87
|
-
}
|
|
88
|
+
},
|
|
89
|
+
undefined)
|
|
88
90
|
).toBe(NOT_APPLICABLE);
|
|
89
91
|
});
|
|
90
92
|
|
|
@@ -97,7 +99,8 @@ describe('Material boolean cell tester', () => {
|
|
|
97
99
|
type: 'boolean'
|
|
98
100
|
}
|
|
99
101
|
}
|
|
100
|
-
}
|
|
102
|
+
},
|
|
103
|
+
undefined)
|
|
101
104
|
).toBe(2);
|
|
102
105
|
});
|
|
103
106
|
});
|
|
@@ -65,23 +65,24 @@ describe('Material boolean toggle cell tester', () => {
|
|
|
65
65
|
};
|
|
66
66
|
|
|
67
67
|
it('should fail', () => {
|
|
68
|
-
expect(materialBooleanToggleCellTester(undefined, undefined)).toBe(
|
|
68
|
+
expect(materialBooleanToggleCellTester(undefined, undefined, undefined)).toBe(
|
|
69
69
|
NOT_APPLICABLE
|
|
70
70
|
);
|
|
71
|
-
expect(materialBooleanToggleCellTester(null, undefined)).toBe(
|
|
71
|
+
expect(materialBooleanToggleCellTester(null, undefined, undefined)).toBe(
|
|
72
72
|
NOT_APPLICABLE
|
|
73
73
|
);
|
|
74
|
-
expect(materialBooleanToggleCellTester({ type: 'Foo' }, undefined)).toBe(
|
|
74
|
+
expect(materialBooleanToggleCellTester({ type: 'Foo' }, undefined, undefined)).toBe(
|
|
75
75
|
NOT_APPLICABLE
|
|
76
76
|
);
|
|
77
77
|
expect(
|
|
78
|
-
materialBooleanToggleCellTester({ type: 'Control' }, undefined)
|
|
78
|
+
materialBooleanToggleCellTester({ type: 'Control' }, undefined, undefined)
|
|
79
79
|
).toBe(NOT_APPLICABLE);
|
|
80
80
|
expect(
|
|
81
81
|
materialBooleanToggleCellTester(control, {
|
|
82
82
|
type: 'object',
|
|
83
83
|
properties: { foo: { type: 'string' } }
|
|
84
|
-
}
|
|
84
|
+
},
|
|
85
|
+
undefined)
|
|
85
86
|
).toBe(NOT_APPLICABLE);
|
|
86
87
|
expect(
|
|
87
88
|
materialBooleanToggleCellTester(control, {
|
|
@@ -94,7 +95,8 @@ describe('Material boolean toggle cell tester', () => {
|
|
|
94
95
|
type: 'boolean'
|
|
95
96
|
}
|
|
96
97
|
}
|
|
97
|
-
}
|
|
98
|
+
},
|
|
99
|
+
undefined)
|
|
98
100
|
).toBe(NOT_APPLICABLE);
|
|
99
101
|
|
|
100
102
|
// Not applicable for boolean cell if toggle option is false
|
|
@@ -114,7 +116,8 @@ describe('Material boolean toggle cell tester', () => {
|
|
|
114
116
|
type: 'boolean'
|
|
115
117
|
}
|
|
116
118
|
}
|
|
117
|
-
}
|
|
119
|
+
},
|
|
120
|
+
undefined
|
|
118
121
|
)
|
|
119
122
|
).toBe(NOT_APPLICABLE);
|
|
120
123
|
|
|
@@ -132,7 +135,8 @@ describe('Material boolean toggle cell tester', () => {
|
|
|
132
135
|
type: 'boolean'
|
|
133
136
|
}
|
|
134
137
|
}
|
|
135
|
-
}
|
|
138
|
+
},
|
|
139
|
+
undefined
|
|
136
140
|
)
|
|
137
141
|
).toBe(NOT_APPLICABLE);
|
|
138
142
|
});
|
|
@@ -146,7 +150,8 @@ describe('Material boolean toggle cell tester', () => {
|
|
|
146
150
|
type: 'boolean'
|
|
147
151
|
}
|
|
148
152
|
}
|
|
149
|
-
}
|
|
153
|
+
},
|
|
154
|
+
undefined)
|
|
150
155
|
).toBe(3);
|
|
151
156
|
});
|
|
152
157
|
});
|
|
@@ -70,23 +70,24 @@ describe('Material boolean toggle control tester', () => {
|
|
|
70
70
|
};
|
|
71
71
|
|
|
72
72
|
it('should fail', () => {
|
|
73
|
-
expect(materialBooleanToggleControlTester(undefined, undefined)).toBe(
|
|
73
|
+
expect(materialBooleanToggleControlTester(undefined, undefined, undefined)).toBe(
|
|
74
74
|
NOT_APPLICABLE
|
|
75
75
|
);
|
|
76
|
-
expect(materialBooleanToggleControlTester(null, undefined)).toBe(
|
|
76
|
+
expect(materialBooleanToggleControlTester(null, undefined, undefined)).toBe(
|
|
77
77
|
NOT_APPLICABLE
|
|
78
78
|
);
|
|
79
|
-
expect(materialBooleanToggleControlTester({ type: 'Foo' }, undefined)).toBe(
|
|
79
|
+
expect(materialBooleanToggleControlTester({ type: 'Foo' }, undefined, undefined)).toBe(
|
|
80
80
|
NOT_APPLICABLE
|
|
81
81
|
);
|
|
82
82
|
expect(
|
|
83
|
-
materialBooleanToggleControlTester({ type: 'Control' }, undefined)
|
|
83
|
+
materialBooleanToggleControlTester({ type: 'Control' }, undefined, undefined)
|
|
84
84
|
).toBe(NOT_APPLICABLE);
|
|
85
85
|
expect(
|
|
86
86
|
materialBooleanToggleControlTester(control, {
|
|
87
87
|
type: 'object',
|
|
88
88
|
properties: { foo: { type: 'string' } }
|
|
89
|
-
}
|
|
89
|
+
},
|
|
90
|
+
undefined)
|
|
90
91
|
).toBe(NOT_APPLICABLE);
|
|
91
92
|
expect(
|
|
92
93
|
materialBooleanToggleControlTester(control, {
|
|
@@ -99,7 +100,8 @@ describe('Material boolean toggle control tester', () => {
|
|
|
99
100
|
type: 'boolean'
|
|
100
101
|
}
|
|
101
102
|
}
|
|
102
|
-
}
|
|
103
|
+
},
|
|
104
|
+
undefined)
|
|
103
105
|
).toBe(NOT_APPLICABLE);
|
|
104
106
|
|
|
105
107
|
// Not applicable for boolean control if toggle option is false
|
|
@@ -119,7 +121,8 @@ describe('Material boolean toggle control tester', () => {
|
|
|
119
121
|
type: 'boolean'
|
|
120
122
|
}
|
|
121
123
|
}
|
|
122
|
-
}
|
|
124
|
+
},
|
|
125
|
+
undefined
|
|
123
126
|
)
|
|
124
127
|
).toBe(NOT_APPLICABLE);
|
|
125
128
|
|
|
@@ -137,7 +140,8 @@ describe('Material boolean toggle control tester', () => {
|
|
|
137
140
|
type: 'boolean'
|
|
138
141
|
}
|
|
139
142
|
}
|
|
140
|
-
}
|
|
143
|
+
},
|
|
144
|
+
undefined
|
|
141
145
|
)
|
|
142
146
|
).toBe(NOT_APPLICABLE);
|
|
143
147
|
});
|
|
@@ -151,7 +155,8 @@ describe('Material boolean toggle control tester', () => {
|
|
|
151
155
|
type: 'boolean'
|
|
152
156
|
}
|
|
153
157
|
}
|
|
154
|
-
}
|
|
158
|
+
},
|
|
159
|
+
undefined)
|
|
155
160
|
).toBe(3);
|
|
156
161
|
});
|
|
157
162
|
});
|
|
@@ -68,11 +68,11 @@ const fixture = {
|
|
|
68
68
|
|
|
69
69
|
describe('Material categorization layout tester', () => {
|
|
70
70
|
it('should not fail when given undefined data', () => {
|
|
71
|
-
expect(materialCategorizationTester(undefined, undefined)).toBe(-1);
|
|
72
|
-
expect(materialCategorizationTester(null, undefined)).toBe(-1);
|
|
73
|
-
expect(materialCategorizationTester({ type: 'Foo' }, undefined)).toBe(-1);
|
|
71
|
+
expect(materialCategorizationTester(undefined, undefined, undefined)).toBe(-1);
|
|
72
|
+
expect(materialCategorizationTester(null, undefined, undefined)).toBe(-1);
|
|
73
|
+
expect(materialCategorizationTester({ type: 'Foo' }, undefined, undefined)).toBe(-1);
|
|
74
74
|
expect(
|
|
75
|
-
materialCategorizationTester({ type: 'Categorization' }, undefined)
|
|
75
|
+
materialCategorizationTester({ type: 'Categorization' }, undefined, undefined)
|
|
76
76
|
).toBe(-1);
|
|
77
77
|
});
|
|
78
78
|
|
|
@@ -81,7 +81,7 @@ describe('Material categorization layout tester', () => {
|
|
|
81
81
|
type: 'Categorization',
|
|
82
82
|
elements: null
|
|
83
83
|
};
|
|
84
|
-
expect(materialCategorizationTester(uischema, undefined)).toBe(-1);
|
|
84
|
+
expect(materialCategorizationTester(uischema, undefined, undefined)).toBe(-1);
|
|
85
85
|
});
|
|
86
86
|
|
|
87
87
|
it('should succeed with empty elements and no schema', () => {
|
|
@@ -89,7 +89,7 @@ describe('Material categorization layout tester', () => {
|
|
|
89
89
|
type: 'Categorization',
|
|
90
90
|
elements: []
|
|
91
91
|
};
|
|
92
|
-
expect(materialCategorizationTester(uischema, undefined)).toBe(1);
|
|
92
|
+
expect(materialCategorizationTester(uischema, undefined, undefined)).toBe(1);
|
|
93
93
|
});
|
|
94
94
|
|
|
95
95
|
it('should not fail tester with single unknown element and no schema', () => {
|
|
@@ -101,7 +101,7 @@ describe('Material categorization layout tester', () => {
|
|
|
101
101
|
}
|
|
102
102
|
]
|
|
103
103
|
};
|
|
104
|
-
expect(materialCategorizationTester(uischema, undefined)).toBe(-1);
|
|
104
|
+
expect(materialCategorizationTester(uischema, undefined, undefined)).toBe(-1);
|
|
105
105
|
});
|
|
106
106
|
|
|
107
107
|
it('should succeed with a single category and no schema', () => {
|
|
@@ -113,7 +113,7 @@ describe('Material categorization layout tester', () => {
|
|
|
113
113
|
}
|
|
114
114
|
]
|
|
115
115
|
};
|
|
116
|
-
expect(materialCategorizationTester(categorization, undefined)).toBe(1);
|
|
116
|
+
expect(materialCategorizationTester(categorization, undefined, undefined)).toBe(1);
|
|
117
117
|
});
|
|
118
118
|
|
|
119
119
|
it('should not apply to a nested categorization with single category and no schema', () => {
|
|
@@ -129,7 +129,7 @@ describe('Material categorization layout tester', () => {
|
|
|
129
129
|
type: 'Categorization',
|
|
130
130
|
elements: [nestedCategorization]
|
|
131
131
|
};
|
|
132
|
-
expect(materialCategorizationTester(categorization, undefined)).toBe(-1);
|
|
132
|
+
expect(materialCategorizationTester(categorization, undefined, undefined)).toBe(-1);
|
|
133
133
|
});
|
|
134
134
|
|
|
135
135
|
it('should not apply to nested categorizations without categories and no schema', () => {
|
|
@@ -141,7 +141,7 @@ describe('Material categorization layout tester', () => {
|
|
|
141
141
|
}
|
|
142
142
|
]
|
|
143
143
|
};
|
|
144
|
-
expect(materialCategorizationTester(categorization, undefined)).toBe(-1);
|
|
144
|
+
expect(materialCategorizationTester(categorization, undefined, undefined)).toBe(-1);
|
|
145
145
|
});
|
|
146
146
|
|
|
147
147
|
it('should not apply to a nested categorization with null elements and no schema', () => {
|
|
@@ -156,7 +156,7 @@ describe('Material categorization layout tester', () => {
|
|
|
156
156
|
]
|
|
157
157
|
};
|
|
158
158
|
|
|
159
|
-
expect(materialCategorizationTester(categorization, undefined)).toBe(-1);
|
|
159
|
+
expect(materialCategorizationTester(categorization, undefined, undefined)).toBe(-1);
|
|
160
160
|
});
|
|
161
161
|
|
|
162
162
|
it('should not apply to a nested categorizations with empty elements and no schema', () => {
|
|
@@ -169,7 +169,7 @@ describe('Material categorization layout tester', () => {
|
|
|
169
169
|
}
|
|
170
170
|
]
|
|
171
171
|
};
|
|
172
|
-
expect(materialCategorizationTester(categorization, undefined)).toBe(-1);
|
|
172
|
+
expect(materialCategorizationTester(categorization, undefined, undefined)).toBe(-1);
|
|
173
173
|
});
|
|
174
174
|
});
|
|
175
175
|
|
|
@@ -68,13 +68,13 @@ const fixture = {
|
|
|
68
68
|
|
|
69
69
|
describe('Material categorization stepper layout tester', () => {
|
|
70
70
|
it('should not fail when given undefined data', () => {
|
|
71
|
-
expect(materialCategorizationStepperTester(undefined, undefined)).toBe(-1);
|
|
72
|
-
expect(materialCategorizationStepperTester(null, undefined)).toBe(-1);
|
|
71
|
+
expect(materialCategorizationStepperTester(undefined, undefined, undefined)).toBe(-1);
|
|
72
|
+
expect(materialCategorizationStepperTester(null, undefined, undefined)).toBe(-1);
|
|
73
73
|
expect(
|
|
74
|
-
materialCategorizationStepperTester({ type: 'Foo' }, undefined)
|
|
74
|
+
materialCategorizationStepperTester({ type: 'Foo' }, undefined, undefined)
|
|
75
75
|
).toBe(-1);
|
|
76
76
|
expect(
|
|
77
|
-
materialCategorizationStepperTester({ type: 'Categorization' }, undefined)
|
|
77
|
+
materialCategorizationStepperTester({ type: 'Categorization' }, undefined, undefined)
|
|
78
78
|
).toBe(-1);
|
|
79
79
|
});
|
|
80
80
|
|
|
@@ -83,7 +83,7 @@ describe('Material categorization stepper layout tester', () => {
|
|
|
83
83
|
type: 'Categorization',
|
|
84
84
|
elements: null
|
|
85
85
|
};
|
|
86
|
-
expect(materialCategorizationStepperTester(uischema, undefined)).toBe(-1);
|
|
86
|
+
expect(materialCategorizationStepperTester(uischema, undefined, undefined)).toBe(-1);
|
|
87
87
|
});
|
|
88
88
|
|
|
89
89
|
it('should not fail with empty elements and no schema', () => {
|
|
@@ -91,7 +91,7 @@ describe('Material categorization stepper layout tester', () => {
|
|
|
91
91
|
type: 'Categorization',
|
|
92
92
|
elements: []
|
|
93
93
|
};
|
|
94
|
-
expect(materialCategorizationStepperTester(uischema, undefined)).toBe(-1);
|
|
94
|
+
expect(materialCategorizationStepperTester(uischema, undefined, undefined)).toBe(-1);
|
|
95
95
|
});
|
|
96
96
|
|
|
97
97
|
it('should not fail tester with single unknown element and no schema', () => {
|
|
@@ -103,7 +103,7 @@ describe('Material categorization stepper layout tester', () => {
|
|
|
103
103
|
}
|
|
104
104
|
]
|
|
105
105
|
};
|
|
106
|
-
expect(materialCategorizationStepperTester(uischema, undefined)).toBe(-1);
|
|
106
|
+
expect(materialCategorizationStepperTester(uischema, undefined, undefined)).toBe(-1);
|
|
107
107
|
});
|
|
108
108
|
|
|
109
109
|
it('should not apply to a single category and no schema', () => {
|
|
@@ -115,7 +115,7 @@ describe('Material categorization stepper layout tester', () => {
|
|
|
115
115
|
}
|
|
116
116
|
]
|
|
117
117
|
};
|
|
118
|
-
expect(materialCategorizationStepperTester(categorization, undefined)).toBe(
|
|
118
|
+
expect(materialCategorizationStepperTester(categorization, undefined, undefined)).toBe(
|
|
119
119
|
-1
|
|
120
120
|
);
|
|
121
121
|
});
|
|
@@ -133,7 +133,7 @@ describe('Material categorization stepper layout tester', () => {
|
|
|
133
133
|
type: 'Categorization',
|
|
134
134
|
elements: [nestedCategorization]
|
|
135
135
|
};
|
|
136
|
-
expect(materialCategorizationStepperTester(categorization, undefined)).toBe(
|
|
136
|
+
expect(materialCategorizationStepperTester(categorization, undefined, undefined)).toBe(
|
|
137
137
|
-1
|
|
138
138
|
);
|
|
139
139
|
});
|
|
@@ -147,7 +147,7 @@ describe('Material categorization stepper layout tester', () => {
|
|
|
147
147
|
}
|
|
148
148
|
]
|
|
149
149
|
};
|
|
150
|
-
expect(materialCategorizationStepperTester(categorization, undefined)).toBe(
|
|
150
|
+
expect(materialCategorizationStepperTester(categorization, undefined, undefined)).toBe(
|
|
151
151
|
-1
|
|
152
152
|
);
|
|
153
153
|
});
|
|
@@ -164,7 +164,7 @@ describe('Material categorization stepper layout tester', () => {
|
|
|
164
164
|
]
|
|
165
165
|
};
|
|
166
166
|
|
|
167
|
-
expect(materialCategorizationStepperTester(categorization, undefined)).toBe(
|
|
167
|
+
expect(materialCategorizationStepperTester(categorization, undefined, undefined)).toBe(
|
|
168
168
|
-1
|
|
169
169
|
);
|
|
170
170
|
});
|
|
@@ -179,7 +179,7 @@ describe('Material categorization stepper layout tester', () => {
|
|
|
179
179
|
}
|
|
180
180
|
]
|
|
181
181
|
};
|
|
182
|
-
expect(materialCategorizationStepperTester(categorization, undefined)).toBe(
|
|
182
|
+
expect(materialCategorizationStepperTester(categorization, undefined, undefined)).toBe(
|
|
183
183
|
-1
|
|
184
184
|
);
|
|
185
185
|
});
|
|
@@ -52,12 +52,12 @@ const uischema: ControlElement = {
|
|
|
52
52
|
|
|
53
53
|
describe('Material date cell', () => {
|
|
54
54
|
it('should fail', () => {
|
|
55
|
-
expect(materialDateCellTester(undefined, undefined)).toBe(NOT_APPLICABLE);
|
|
56
|
-
expect(materialDateCellTester(null, undefined)).toBe(NOT_APPLICABLE);
|
|
57
|
-
expect(materialDateCellTester({ type: 'Foo' }, undefined)).toBe(
|
|
55
|
+
expect(materialDateCellTester(undefined, undefined, undefined)).toBe(NOT_APPLICABLE);
|
|
56
|
+
expect(materialDateCellTester(null, undefined, undefined)).toBe(NOT_APPLICABLE);
|
|
57
|
+
expect(materialDateCellTester({ type: 'Foo' }, undefined, undefined)).toBe(
|
|
58
58
|
NOT_APPLICABLE
|
|
59
59
|
);
|
|
60
|
-
expect(materialDateCellTester({ type: 'Control' }, undefined)).toBe(
|
|
60
|
+
expect(materialDateCellTester({ type: 'Control' }, undefined, undefined)).toBe(
|
|
61
61
|
NOT_APPLICABLE
|
|
62
62
|
);
|
|
63
63
|
|
|
@@ -67,7 +67,8 @@ describe('Material date cell', () => {
|
|
|
67
67
|
properties: {
|
|
68
68
|
foo: { type: 'string' }
|
|
69
69
|
}
|
|
70
|
-
}
|
|
70
|
+
},
|
|
71
|
+
undefined)
|
|
71
72
|
).toBe(NOT_APPLICABLE);
|
|
72
73
|
expect(
|
|
73
74
|
materialDateCellTester(uischema, {
|
|
@@ -79,7 +80,8 @@ describe('Material date cell', () => {
|
|
|
79
80
|
format: 'date'
|
|
80
81
|
}
|
|
81
82
|
}
|
|
82
|
-
}
|
|
83
|
+
},
|
|
84
|
+
undefined)
|
|
83
85
|
).toBe(NOT_APPLICABLE);
|
|
84
86
|
});
|
|
85
87
|
|
|
@@ -93,7 +95,8 @@ describe('Material date cell', () => {
|
|
|
93
95
|
format: 'date'
|
|
94
96
|
}
|
|
95
97
|
}
|
|
96
|
-
}
|
|
98
|
+
},
|
|
99
|
+
undefined)
|
|
97
100
|
).toBe(2);
|
|
98
101
|
});
|
|
99
102
|
});
|
|
@@ -57,14 +57,14 @@ const uischema: ControlElement = {
|
|
|
57
57
|
|
|
58
58
|
describe('Material date control tester', () => {
|
|
59
59
|
test('should fail', () => {
|
|
60
|
-
expect(materialDateControlTester(undefined, undefined)).toBe(
|
|
60
|
+
expect(materialDateControlTester(undefined, undefined, undefined)).toBe(
|
|
61
61
|
NOT_APPLICABLE
|
|
62
62
|
);
|
|
63
|
-
expect(materialDateControlTester(null, undefined)).toBe(NOT_APPLICABLE);
|
|
64
|
-
expect(materialDateControlTester({ type: 'Foo' }, undefined)).toBe(
|
|
63
|
+
expect(materialDateControlTester(null, undefined, undefined)).toBe(NOT_APPLICABLE);
|
|
64
|
+
expect(materialDateControlTester({ type: 'Foo' }, undefined, undefined)).toBe(
|
|
65
65
|
NOT_APPLICABLE
|
|
66
66
|
);
|
|
67
|
-
expect(materialDateControlTester({ type: 'Control' }, undefined)).toBe(
|
|
67
|
+
expect(materialDateControlTester({ type: 'Control' }, undefined, undefined)).toBe(
|
|
68
68
|
NOT_APPLICABLE
|
|
69
69
|
);
|
|
70
70
|
expect(
|
|
@@ -73,7 +73,8 @@ describe('Material date 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
|
materialDateControlTester(uischema, {
|
|
@@ -85,7 +86,8 @@ describe('Material date control tester', () => {
|
|
|
85
86
|
format: 'date'
|
|
86
87
|
}
|
|
87
88
|
}
|
|
88
|
-
}
|
|
89
|
+
},
|
|
90
|
+
undefined)
|
|
89
91
|
).toBe(NOT_APPLICABLE);
|
|
90
92
|
});
|
|
91
93
|
|
|
@@ -99,7 +101,8 @@ describe('Material date control tester', () => {
|
|
|
99
101
|
format: 'date'
|
|
100
102
|
}
|
|
101
103
|
}
|
|
102
|
-
}
|
|
104
|
+
},
|
|
105
|
+
undefined)
|
|
103
106
|
).toBe(4);
|
|
104
107
|
expect(
|
|
105
108
|
materialDateControlTester(
|
|
@@ -111,7 +114,8 @@ describe('Material date control tester', () => {
|
|
|
111
114
|
type: 'string'
|
|
112
115
|
}
|
|
113
116
|
}
|
|
114
|
-
}
|
|
117
|
+
},
|
|
118
|
+
undefined
|
|
115
119
|
)
|
|
116
120
|
).toBe(4);
|
|
117
121
|
});
|
|
@@ -58,14 +58,14 @@ const uischema: ControlElement = {
|
|
|
58
58
|
|
|
59
59
|
describe('Material date time control tester', () => {
|
|
60
60
|
it('should fail', () => {
|
|
61
|
-
expect(materialDateTimeControlTester(undefined, undefined)).toBe(
|
|
61
|
+
expect(materialDateTimeControlTester(undefined, undefined, undefined)).toBe(
|
|
62
62
|
NOT_APPLICABLE
|
|
63
63
|
);
|
|
64
|
-
expect(materialDateTimeControlTester(null, undefined)).toBe(NOT_APPLICABLE);
|
|
65
|
-
expect(materialDateTimeControlTester({ type: 'Foo' }, undefined)).toBe(
|
|
64
|
+
expect(materialDateTimeControlTester(null, undefined, undefined)).toBe(NOT_APPLICABLE);
|
|
65
|
+
expect(materialDateTimeControlTester({ type: 'Foo' }, undefined, undefined)).toBe(
|
|
66
66
|
NOT_APPLICABLE
|
|
67
67
|
);
|
|
68
|
-
expect(materialDateTimeControlTester({ type: 'Control' }, undefined)).toBe(
|
|
68
|
+
expect(materialDateTimeControlTester({ type: 'Control' }, undefined, undefined)).toBe(
|
|
69
69
|
NOT_APPLICABLE
|
|
70
70
|
);
|
|
71
71
|
expect(
|
|
@@ -74,7 +74,8 @@ describe('Material date time control tester', () => {
|
|
|
74
74
|
properties: {
|
|
75
75
|
foo: { type: 'string' }
|
|
76
76
|
}
|
|
77
|
-
}
|
|
77
|
+
},
|
|
78
|
+
undefined)
|
|
78
79
|
).toBe(NOT_APPLICABLE);
|
|
79
80
|
expect(
|
|
80
81
|
materialDateTimeControlTester(uischema, {
|
|
@@ -86,7 +87,8 @@ describe('Material date time control tester', () => {
|
|
|
86
87
|
format: 'date-time'
|
|
87
88
|
}
|
|
88
89
|
}
|
|
89
|
-
}
|
|
90
|
+
},
|
|
91
|
+
undefined)
|
|
90
92
|
).toBe(NOT_APPLICABLE);
|
|
91
93
|
});
|
|
92
94
|
|
|
@@ -100,7 +102,8 @@ describe('Material date time control tester', () => {
|
|
|
100
102
|
format: 'date-time'
|
|
101
103
|
}
|
|
102
104
|
}
|
|
103
|
-
}
|
|
105
|
+
},
|
|
106
|
+
undefined)
|
|
104
107
|
).toBe(2);
|
|
105
108
|
expect(
|
|
106
109
|
materialDateTimeControlTester(
|
|
@@ -112,7 +115,8 @@ describe('Material date time control tester', () => {
|
|
|
112
115
|
type: 'string'
|
|
113
116
|
}
|
|
114
117
|
}
|
|
115
|
-
}
|
|
118
|
+
},
|
|
119
|
+
undefined
|
|
116
120
|
)
|
|
117
121
|
).toBe(2);
|
|
118
122
|
});
|
|
@@ -51,7 +51,8 @@ describe('EnumArrayControl tester', () => {
|
|
|
51
51
|
materialEnumArrayRendererTester(uischema, {
|
|
52
52
|
type: 'array',
|
|
53
53
|
items: {}
|
|
54
|
-
}
|
|
54
|
+
},
|
|
55
|
+
undefined)
|
|
55
56
|
).toBe(NOT_APPLICABLE);
|
|
56
57
|
expect(
|
|
57
58
|
materialEnumArrayRendererTester(uischema, {
|
|
@@ -59,12 +60,13 @@ describe('EnumArrayControl tester', () => {
|
|
|
59
60
|
items: {
|
|
60
61
|
anyOf: []
|
|
61
62
|
}
|
|
62
|
-
}
|
|
63
|
+
},
|
|
64
|
+
undefined)
|
|
63
65
|
).toBe(NOT_APPLICABLE);
|
|
64
66
|
});
|
|
65
67
|
|
|
66
68
|
it('should succeed for schema with enum items', () => {
|
|
67
|
-
expect(materialEnumArrayRendererTester(uischema, enumSchema)).toBe(5);
|
|
69
|
+
expect(materialEnumArrayRendererTester(uischema, enumSchema, undefined)).toBe(5);
|
|
68
70
|
});
|
|
69
71
|
});
|
|
70
72
|
|
|
@@ -113,7 +115,7 @@ describe('EnumArrayControl', () => {
|
|
|
113
115
|
);
|
|
114
116
|
const labels = wrapper.find('label');
|
|
115
117
|
expect(labels.first().text()).toBe('My Title');
|
|
116
|
-
expect(labels.last().text()).toBe('
|
|
118
|
+
expect(labels.last().text()).toBe('bar');
|
|
117
119
|
});
|
|
118
120
|
|
|
119
121
|
test('oneOf items - updates data', (done) => {
|
|
@@ -176,9 +178,9 @@ describe('EnumArrayControl', () => {
|
|
|
176
178
|
/>
|
|
177
179
|
);
|
|
178
180
|
const labels = wrapper.find('label');
|
|
179
|
-
expect(labels.at(0).text()).toBe('
|
|
180
|
-
expect(labels.at(1).text()).toBe('
|
|
181
|
-
expect(labels.at(2).text()).toBe('
|
|
181
|
+
expect(labels.at(0).text()).toBe('a');
|
|
182
|
+
expect(labels.at(1).text()).toBe('b');
|
|
183
|
+
expect(labels.at(2).text()).toBe('c');
|
|
182
184
|
});
|
|
183
185
|
|
|
184
186
|
test('enum items - updates data', (done) => {
|