diff options
Diffstat (limited to 'spec/frontend/vue_mr_widget/components/extensions/actions_spec.js')
-rw-r--r-- | spec/frontend/vue_mr_widget/components/extensions/actions_spec.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/frontend/vue_mr_widget/components/extensions/actions_spec.js b/spec/frontend/vue_mr_widget/components/extensions/actions_spec.js index d5d779d7a34..a13db2f4d72 100644 --- a/spec/frontend/vue_mr_widget/components/extensions/actions_spec.js +++ b/spec/frontend/vue_mr_widget/components/extensions/actions_spec.js @@ -24,6 +24,18 @@ describe('MR widget extension actions', () => { expect(wrapper.findAllComponents(GlButton)).toHaveLength(1); }); + it('calls action click handler', async () => { + const onClick = jest.fn(); + + factory({ + tertiaryButtons: [{ text: 'hello world', onClick }], + }); + + await wrapper.findComponent(GlButton).vm.$emit('click'); + + expect(onClick).toHaveBeenCalled(); + }); + it('renders tertiary actions in dropdown', () => { factory({ tertiaryButtons: [{ text: 'hello world', href: 'https://gitlab.com', target: '_blank' }], |