Skip to content

Commit 2121d70

Browse files
committed
Add another internal attr calculateDynamicProperties
1 parent 301e822 commit 2121d70

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/helpers.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ const dynamicInternalJsfAttrs = [
2424
'calculateConditionalProperties', // driven from conditionals
2525
'calculateCustomValidationProperties', // To be deprecated in favor of json-logic
2626
'scopedJsonSchema', // The respective JSON Schema
27-
'Component', // HOTFIX/TODO Internal customizations, check test conditions.test.js for more info.
27+
28+
// HOTFIX/TODO Internal customizations, check test conditions.test.js for more info.
29+
'Component',
30+
'calculateDynamicProperties',
2831
];
2932
const dynamicInternalJsfAttrsObj = Object.fromEntries(
3033
dynamicInternalJsfAttrs.map((k) => [k, true])

src/tests/conditions.test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,20 +396,24 @@ describe('Conditional attributes updated', () => {
396396
customProperties: {
397397
salary_period: {
398398
Component: '<A React Component>',
399+
calculateDynamicProperties: () => true,
399400
},
400401
},
401402
}
402403
);
403404

404405
// It's there by default
405406
expect(fields[1].Component).toBe('<A React Component>');
407+
expect(fields[1].calculateDynamicProperties).toEqual(expect.any(Function));
406408

407409
// Given "Yes", it stays there too.
408410
handleValidation({ is_full_time: 'yes' });
409411
expect(fields[1].Component).toBe('<A React Component>');
412+
expect(fields[1].calculateDynamicProperties).toEqual(expect.any(Function));
410413

411414
// Given "No", it stays there too.
412415
handleValidation({ is_full_time: 'no' });
413416
expect(fields[1].Component).toBe('<A React Component>');
417+
expect(fields[1].calculateDynamicProperties).toEqual(expect.any(Function));
414418
});
415419
});

0 commit comments

Comments
 (0)