aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/config/validation-helpers/utils.spec.ts
blob: 8344eed039e32323f4757fcc168805342f5d1944 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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');
    });
  });
});