diff options
Diffstat (limited to 'spec/frontend/ci/pipeline_new/utils/filter_variables_spec.js')
-rw-r--r-- | spec/frontend/ci/pipeline_new/utils/filter_variables_spec.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/frontend/ci/pipeline_new/utils/filter_variables_spec.js b/spec/frontend/ci/pipeline_new/utils/filter_variables_spec.js new file mode 100644 index 00000000000..d1b89704b58 --- /dev/null +++ b/spec/frontend/ci/pipeline_new/utils/filter_variables_spec.js @@ -0,0 +1,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); + }); +}); |