@@ -15,6 +15,8 @@ import {
1515 schemaWithNativeAndJSONLogicChecks ,
1616 schemaWithNonRequiredField ,
1717 schemaWithTwoRules ,
18+ schemaWithUnknownVariableInComputedValues ,
19+ schemaWithUnknownVariableInValidations ,
1820} from './jsonLogic.fixtures' ;
1921import { mockConsole , restoreConsoleAndEnsureItWasNotCalled } from './testUtils' ;
2022
@@ -102,6 +104,16 @@ describe('jsonLogic: cross-values validations', () => {
102104 schemaWithMissingRule ,
103105 '[json-schema-form] json-logic error: Validation "a_greater_than_ten" has missing rule.' ,
104106 ] ,
107+ [
108+ 'x-jsf-validations: throw when theres a value that does not exist in a rule' ,
109+ schemaWithUnknownVariableInValidations ,
110+ '"field_a" in rule "a_equals_ten" does not exist as a JSON schema property.' ,
111+ ] ,
112+ [
113+ 'x-jsf-validations: throw when theres a value that does not exist in a rule' ,
114+ schemaWithUnknownVariableInComputedValues ,
115+ '"field_a" in rule "a_times_ten" does not exist as a JSON schema property.' ,
116+ ] ,
105117 [
106118 'x-jsf-logic.computedValues: throw when theres a missing computed value' ,
107119 schemaWithMissingComputedValue ,
0 commit comments