diff options
author | Miranda Fluharty <mfluharty@gitlab.com> | 2019-03-27 22:13:55 +0300 |
---|---|---|
committer | Kamil TrzciĆski <ayufan@ayufan.eu> | 2019-03-27 22:13:55 +0300 |
commit | fc8f4b62f887abbc02e2c21b7275f53b51a5bad2 (patch) | |
tree | 3644afa753f4fe855302342bc7f2e56bf17f80e3 /spec/javascripts/ci_variable_list | |
parent | 95325c6ab7343f5c241fe63b3e0e782372e93245 (diff) |
Scaffold UI elements for minimal version
Add a masked switch to variable rows
Copy some behavior from the protected switch
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); |