summaryrefslogtreecommitdiff
path: root/spec/frontend/pipeline_new/utils/filter_variables_spec.js
blob: 42bc62444564cce88ab94bffac8b51c5fce2c3c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import filterVariables from '~/pipeline_new/utils/filter_variables';
import { mockVariables } from '../mock_data';

describe('Filter variables utility function', () => {
  it('filters variables that do not contain a key', () => {
    const expectedVaraibles = [
      {
        variable_type: 'env_var',
        key: 'var_without_value',
        secret_value: '',
      },
      {
        variable_type: 'env_var',
        key: 'var_with_value',
        secret_value: 'test_value',
      },
    ];

    expect(filterVariables(mockVariables)).toEqual(expectedVaraibles);
  });
});