Welcome to mirror list, hosted at ThFree Co, Russian Federation.

filter_variables_spec.js « utils « pipeline_new « ci « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d1b89704b58a6f0278e74c353847b0f00861bbf8 (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 '~/ci/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);
  });
});