diff options
Diffstat (limited to 'lib/config/validation-helpers/utils.spec.ts')
-rw-r--r-- | lib/config/validation-helpers/utils.spec.ts | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/config/validation-helpers/utils.spec.ts b/lib/config/validation-helpers/utils.spec.ts new file mode 100644 index 00000000000..8344eed039e --- /dev/null +++ b/lib/config/validation-helpers/utils.spec.ts @@ -0,0 +1,17 @@ +import { getParentName } from './utils'; + +describe('config/validation-helpers/utils', () => { + describe('getParentName()', () => { + it('ignores encrypted in root', () => { + expect(getParentName('encrypted')).toBeEmptyString(); + }); + + it('handles array types', () => { + expect(getParentName('hostRules[1]')).toBe('hostRules'); + }); + + it('handles encrypted within array types', () => { + expect(getParentName('hostRules[0].encrypted')).toBe('hostRules'); + }); + }); +}); |