@@ -36,13 +36,9 @@ import { UPDATE_DATA, UpdateAction } from '../../src/actions';
36
36
import configureStore from 'redux-mock-store' ;
37
37
import {
38
38
ControlElement ,
39
- createAjv ,
40
- defaultErrorTranslator ,
41
39
JsonFormsState ,
42
- JsonSchema ,
43
40
RuleEffect ,
44
- UISchemaElement ,
45
- validate
41
+ UISchemaElement
46
42
} from '../../src' ;
47
43
import { enumToEnumOptionMapper } from '../../src/util/renderer' ;
48
44
@@ -274,29 +270,6 @@ test('mapStateToCellProps - id', t => {
274
270
t . is ( props . id , '#/properties/firstName' ) ;
275
271
} ) ;
276
272
277
- test ( 'mapStateToCellProps - translated error' , t => {
278
- const ownProps = {
279
- uischema : coreUISchema ,
280
- id : '#/properties/firstName'
281
- } ;
282
- const state = createState ( coreUISchema ) ;
283
- const schema = state . jsonforms . core ?. schema as JsonSchema ;
284
- const data = state . jsonforms . core ?. data as any ;
285
- // mark firstName as required, delete the value from data, then get errors from ajv from the compiled schema
286
- schema . required = [ "firstName" ] ;
287
- delete data . firstName ;
288
- const ajv = createAjv ( ) ;
289
- const v = ajv . compile ( schema ) ;
290
- state . jsonforms . errors = validate ( v , data ) ;
291
- // add a mock i18n state to verify that the error gets translated
292
- state . jsonforms . i18n = {
293
- translateError : ( error ) => `i18n-error:${ error . keyword } ` ,
294
- translate : ( id : string ) => `i18n-key:${ id } `
295
- } ;
296
- const props = mapStateToCellProps ( state , ownProps ) ;
297
- t . is ( props . errors , 'i18n-error:required' ) ;
298
- } ) ;
299
-
300
273
test ( 'mapStateToEnumCellProps - set default options for dropdown list' , t => {
301
274
const uischema : ControlElement = {
302
275
type : 'Control' ,
0 commit comments