|
9 | 9 | CUSTOM_BLOCK_BOOLEAN_UNSET, |
10 | 10 | customBlockBooleanOptions, |
11 | 11 | customBlockInputControl, |
| 12 | + isForkSyncConfigurableField, |
12 | 13 | } from '@/ee/workspace-forking/components/fork-sync/custom-block-input-control' |
13 | 14 |
|
14 | 15 | describe('customBlockInputControl', () => { |
@@ -50,6 +51,31 @@ describe('customBlockInputControl', () => { |
50 | 51 | }) |
51 | 52 | }) |
52 | 53 |
|
| 54 | +describe('isForkSyncConfigurableField', () => { |
| 55 | + it('excludes a custom block’s file input from the Sync gate', () => { |
| 56 | + // The modal renders it disabled, so a REQUIRED one could never be satisfied: Sync would |
| 57 | + // stay off forever while the hint told the user to set it in a workflow they can only |
| 58 | + // reach by syncing. The sync no longer clears the field, so skipping the gate is safe. |
| 59 | + expect(isForkSyncConfigurableField({ parentKind: 'custom-block', fieldType: 'file[]' })).toBe( |
| 60 | + false |
| 61 | + ) |
| 62 | + }) |
| 63 | + |
| 64 | + it('still gates every custom-block input that HAS a control', () => { |
| 65 | + for (const fieldType of ['string', 'number', 'boolean', 'object', 'array']) { |
| 66 | + expect(isForkSyncConfigurableField({ parentKind: 'custom-block', fieldType })).toBe(true) |
| 67 | + } |
| 68 | + }) |
| 69 | + |
| 70 | + it('leaves every other parent kind gated', () => { |
| 71 | + // Only custom-block inputs classify their own control here; a selector-backed dependent |
| 72 | + // is always configurable. |
| 73 | + for (const parentKind of ['credential', 'knowledge-base', 'table'] as const) { |
| 74 | + expect(isForkSyncConfigurableField({ parentKind, fieldType: 'file[]' })).toBe(true) |
| 75 | + } |
| 76 | + }) |
| 77 | +}) |
| 78 | + |
53 | 79 | describe('customBlockBooleanOptions', () => { |
54 | 80 | it('lets an OPTIONAL flag return to the workflow default', () => { |
55 | 81 | // Without this a single click permanently pins the flag: a two-segment switch has no |
|
0 commit comments