diff options
author | mfluharty <mfluharty@gitlab.com> | 2019-03-29 09:46:31 -0600 |
---|---|---|
committer | mfluharty <mfluharty@gitlab.com> | 2019-03-29 12:49:59 -0600 |
commit | 0481d699075ea48c67037088713689b8d66f1983 (patch) | |
tree | 200b5c4c0a4fac3f416ad4b8dbb402caa0a2eae7 /spec/javascripts/ci_variable_list | |
parent | ee8f3d5cd806c5558a2153b1a545b371c47c600f (diff) | |
download | gitlab-ce-0481d699075ea48c67037088713689b8d66f1983.tar.gz |
Add control for variable value masking
Show masked switch for each variable
When toggled on, the variable value will be masked in runner logs
Show warning message if the switch is on but the value is not maskable
Diffstat (limited to 'spec/javascripts/ci_variable_list')
-rw-r--r-- | spec/javascripts/ci_variable_list/ci_variable_list_spec.js | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/spec/javascripts/ci_variable_list/ci_variable_list_spec.js b/spec/javascripts/ci_variable_list/ci_variable_list_spec.js index 70f49469300..394e60fc22c 100644 --- a/spec/javascripts/ci_variable_list/ci_variable_list_spec.js +++ b/spec/javascripts/ci_variable_list/ci_variable_list_spec.js @@ -127,20 +127,25 @@ describe('VariableList', () => { variableList.init(); }); - it('should add another row when editing the last rows protected checkbox', done => { + it('should not add another row when editing the last rows protected checkbox', done => { const $row = $wrapper.find('.js-row:last-child'); $row.find('.ci-variable-protected-item .js-project-feature-toggle').click(); getSetTimeoutPromise() .then(() => { - expect($wrapper.find('.js-row').length).toBe(2); + expect($wrapper.find('.js-row').length).toBe(1); + }) + .then(done) + .catch(done.fail); + }); - // Check for the correct default in the new row - const $protectedInput = $wrapper - .find('.js-row:last-child') - .find('.js-ci-variable-input-protected'); + it('should not add another row when editing the last rows masked checkbox', done => { + const $row = $wrapper.find('.js-row:last-child'); + $row.find('.ci-variable-masked-item .js-project-feature-toggle').click(); - expect($protectedInput.val()).toBe('false'); + getSetTimeoutPromise() + .then(() => { + expect($wrapper.find('.js-row').length).toBe(1); }) .then(done) .catch(done.fail); |