diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-29 15:08:09 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-29 15:08:09 +0300 |
commit | 1a8b381312dc666a93c1bc3879ad15b1350de300 (patch) | |
tree | 58e744b5a04e9df5b2aefe6990ac28389b9698e2 /spec/frontend/vue_merge_request_widget | |
parent | 55dea17c8d10d1b25cd25f1cdaeaed64332995a7 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/vue_merge_request_widget')
-rw-r--r-- | spec/frontend/vue_merge_request_widget/components/widget/widget_spec.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/frontend/vue_merge_request_widget/components/widget/widget_spec.js b/spec/frontend/vue_merge_request_widget/components/widget/widget_spec.js index 5887670a58d..ea7dabf34c9 100644 --- a/spec/frontend/vue_merge_request_widget/components/widget/widget_spec.js +++ b/spec/frontend/vue_merge_request_widget/components/widget/widget_spec.js @@ -287,6 +287,21 @@ describe('~/vue_merge_request_widget/components/widget/widget.vue', () => { expect(findExpandedSection().text()).toBe('More complex content'); }); + it('emits a toggle even when button is toggled', async () => { + createComponent({ + propsData: { + isCollapsible: true, + }, + slots: { + content: '<b>More complex content</b>', + }, + }); + + expect(findExpandedSection().exists()).toBe(false); + findToggleButton().vm.$emit('click'); + expect(wrapper.emitted('toggle')).toEqual([[{ expanded: true }]]); + }); + it('does not display the toggle button if isCollapsible is false', () => { createComponent({ propsData: { |