Skip to content

Commit 9828188

Browse files
codefactorsap-codefactor
authored andcommitted
fix: rollback the unit test
1 parent 780c3d9 commit 9828188

File tree

1 file changed

+1
-28
lines changed

1 file changed

+1
-28
lines changed

packages/core/test/util/cell.test.ts

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,9 @@ import { UPDATE_DATA, UpdateAction } from '../../src/actions';
3636
import configureStore from 'redux-mock-store';
3737
import {
3838
ControlElement,
39-
createAjv,
40-
defaultErrorTranslator,
4139
JsonFormsState,
42-
JsonSchema,
4340
RuleEffect,
44-
UISchemaElement,
45-
validate
41+
UISchemaElement
4642
} from '../../src';
4743
import { enumToEnumOptionMapper } from '../../src/util/renderer';
4844

@@ -274,29 +270,6 @@ test('mapStateToCellProps - id', t => {
274270
t.is(props.id, '#/properties/firstName');
275271
});
276272

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-
300273
test('mapStateToEnumCellProps - set default options for dropdown list', t => {
301274
const uischema: ControlElement = {
302275
type: 'Control',

0 commit comments

Comments
 (0)