diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-21 09:08:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-21 09:08:36 +0300 |
commit | 2b9f6cfb3fc31259e923ca929d585b7fa643f39a (patch) | |
tree | b8442fca980b99a9430d2910e634198d80ca9505 /spec/frontend/issues | |
parent | bc69b91579a1406bc62eb2ea696e5e35cff56d59 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/issues')
-rw-r--r-- | spec/frontend/issues/show/components/delete_issue_modal_spec.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/spec/frontend/issues/show/components/delete_issue_modal_spec.js b/spec/frontend/issues/show/components/delete_issue_modal_spec.js index b8adeb24005..f122180a403 100644 --- a/spec/frontend/issues/show/components/delete_issue_modal_spec.js +++ b/spec/frontend/issues/show/components/delete_issue_modal_spec.js @@ -37,11 +37,14 @@ describe('DeleteIssueModal component', () => { }); describe('when "primary" event is emitted', () => { - let formSubmitSpy; + const submitMock = jest.fn(); + // Mock the form submit method + Object.defineProperty(HTMLFormElement.prototype, 'submit', { + value: submitMock, + }); beforeEach(() => { wrapper = mountComponent(); - formSubmitSpy = jest.spyOn(wrapper.vm.$refs.form, 'submit'); findModal().vm.$emit('primary'); }); @@ -50,7 +53,7 @@ describe('DeleteIssueModal component', () => { }); it('submits the form', () => { - expect(formSubmitSpy).toHaveBeenCalled(); + expect(submitMock).toHaveBeenCalledTimes(1); }); }); }); |