Emit toggleSidebar
event on component when icon is clicked
This commit is contained in:
parent
342fbbdaa2
commit
e164447bf1
2 changed files with 18 additions and 0 deletions
|
@ -70,6 +70,9 @@
|
|||
toggleMoreParticipants() {
|
||||
this.isShowingMoreParticipants = !this.isShowingMoreParticipants;
|
||||
},
|
||||
onClickCollapsedIcon() {
|
||||
this.$emit('toggleSidebar');
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@ -82,6 +85,7 @@
|
|||
data-container="body"
|
||||
data-placement="left"
|
||||
:title="participantLabel"
|
||||
@click="onClickCollapsedIcon"
|
||||
>
|
||||
<i
|
||||
class="fa fa-users"
|
||||
|
|
|
@ -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');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue