diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2019-08-06 17:11:13 +0100 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2019-08-07 16:42:17 +0100 |
commit | 85e0eb472dc33ae561c4b04b498c61f91fb7aa3e (patch) | |
tree | 6a0275744ff9c679e7a51cbf18b7edaa6cd1ea5b /spec/javascripts | |
parent | 4aa824e7059889c7b8badb4bd43cc44f9a01201f (diff) | |
download | gitlab-ce-85e0eb472dc33ae561c4b04b498c61f91fb7aa3e.tar.gz |
Makes title section collapsible63181-collapsible-line
In the job log, if the user clicks the section title
the job log section will be collapsed
Diffstat (limited to 'spec/javascripts')
-rw-r--r-- | spec/javascripts/jobs/components/job_log_spec.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/javascripts/jobs/components/job_log_spec.js b/spec/javascripts/jobs/components/job_log_spec.js index 7e2ec2ec3f7..3485eec7763 100644 --- a/spec/javascripts/jobs/components/job_log_spec.js +++ b/spec/javascripts/jobs/components/job_log_spec.js @@ -98,5 +98,25 @@ describe('Job Log', () => { .then(done) .catch(done.fail); }); + + it('toggles hidden class to the sibilings rows when header section is clicked', done => { + vm.$nextTick() + .then(() => { + const { section } = vm.$el.querySelector('.js-section-header').dataset; + vm.$el.querySelector('.js-section-header').click(); + + vm.$el.querySelectorAll(`.js-s-${section}:not(.js-section-header)`).forEach(el => { + expect(el.classList.contains('hidden')).toEqual(true); + }); + + vm.$el.querySelector('.js-section-header').click(); + + vm.$el.querySelectorAll(`.js-s-${section}:not(.js-section-header)`).forEach(el => { + expect(el.classList.contains('hidden')).toEqual(false); + }); + }) + .then(done) + .catch(done.fail); + }); }); }); |