diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-01 12:09:08 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-01 12:09:08 +0000 |
commit | a4c655515155710b3695699ea88d824f65af6446 (patch) | |
tree | f5064d57376d2ae34d470c01b516802bcd909224 /spec/frontend | |
parent | a66a37ceff963198142f0deaecaa4ac2719ef8c7 (diff) | |
download | gitlab-ce-a4c655515155710b3695699ea88d824f65af6446.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend')
-rw-r--r-- | spec/frontend/vue_shared/components/gl_modal_vuex_spec.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/frontend/vue_shared/components/gl_modal_vuex_spec.js b/spec/frontend/vue_shared/components/gl_modal_vuex_spec.js index 8437e68d73c..93f4db5df18 100644 --- a/spec/frontend/vue_shared/components/gl_modal_vuex_spec.js +++ b/spec/frontend/vue_shared/components/gl_modal_vuex_spec.js @@ -38,6 +38,9 @@ describe('GlModalVuex', () => { localVue, store, propsData, + stubs: { + GlModal, + }, }); }; @@ -148,4 +151,29 @@ describe('GlModalVuex', () => { .then(done) .catch(done.fail); }); + + it.each(['ok', 'cancel'])( + 'passes an "%s" handler to the "modal-footer" slot scope', + handlerName => { + state.isVisible = true; + + const modalFooterSlotContent = jest.fn(); + + factory({ + scopedSlots: { + 'modal-footer': modalFooterSlotContent, + }, + }); + + const handler = modalFooterSlotContent.mock.calls[0][0][handlerName]; + + expect(wrapper.emitted(handlerName)).toBeFalsy(); + expect(actions.hide).not.toHaveBeenCalled(); + + handler(); + + expect(actions.hide).toHaveBeenCalledTimes(1); + expect(wrapper.emitted(handlerName)).toBeTruthy(); + }, + ); }); |