diff options
author | Kushal Pandya <kushal@gitlab.com> | 2018-05-03 12:35:17 +0300 |
---|---|---|
committer | Kushal Pandya <kushal@gitlab.com> | 2018-05-03 14:04:03 +0300 |
commit | e164447bf1c110f2b0df2589c4a7be1388d07151 (patch) | |
tree | d52148da6ad7b8f1e55cf9f877c52482f389a768 /spec/javascripts/sidebar/participants_spec.js | |
parent | 342fbbdaa2f7bdf2ac9cecdbcce55ae0f3f09485 (diff) |
Emit `toggleSidebar` event on component when icon is clicked
Diffstat (limited to 'spec/javascripts/sidebar/participants_spec.js')
-rw-r--r-- | spec/javascripts/sidebar/participants_spec.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/javascripts/sidebar/participants_spec.js b/spec/javascripts/sidebar/participants_spec.js index 2a3b60c399c..e796ddee62f 100644 --- a/spec/javascripts/sidebar/participants_spec.js +++ b/spec/javascripts/sidebar/participants_spec.js @@ -170,5 +170,19 @@ describe('Participants', function () { expect(vm.isShowingMoreParticipants).toBe(true); }); + + it('clicking on participants icon emits `toggleSidebar` event', () => { + vm = mountComponent(Participants, { + loading: false, + participants: PARTICIPANT_LIST, + numberOfLessParticipants: 2, + }); + spyOn(vm, '$emit'); + + const participantsIconEl = vm.$el.querySelector('.sidebar-collapsed-icon'); + + participantsIconEl.click(); + expect(vm.$emit).toHaveBeenCalledWith('toggleSidebar'); + }); }); }); |