Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/projects/commit/components/form_modal_spec.js')
-rw-r--r--spec/frontend/projects/commit/components/form_modal_spec.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/spec/frontend/projects/commit/components/form_modal_spec.js b/spec/frontend/projects/commit/components/form_modal_spec.js
index d40e2d7a48c..7ea3a74418d 100644
--- a/spec/frontend/projects/commit/components/form_modal_spec.js
+++ b/spec/frontend/projects/commit/components/form_modal_spec.js
@@ -72,11 +72,11 @@ describe('CommitFormModal', () => {
it('Shows modal', () => {
createComponent();
- const rootEmit = jest.spyOn(wrapper.vm.$root, '$emit');
+ const rootWrapper = createWrapper(wrapper.vm.$root);
- wrapper.vm.show();
+ eventHub.$emit(mockData.modalPropsData.openModal);
- expect(rootEmit).toHaveBeenCalledWith(BV_SHOW_MODAL, mockData.modalPropsData.modalId);
+ expect(rootWrapper.emitted(BV_SHOW_MODAL)[0]).toContain(mockData.modalPropsData.modalId);
});
it('Clears the modal state once modal is hidden', () => {
@@ -150,8 +150,9 @@ describe('CommitFormModal', () => {
it('Action primary button dispatches submit action', () => {
getByText(mockData.modalPropsData.i18n.actionPrimaryText).trigger('click');
+ const formSubmitSpy = jest.spyOn(findForm().element, 'submit');
- expect(wrapper.vm.$refs.form.$el.submit).toHaveBeenCalled();
+ expect(formSubmitSpy).toHaveBeenCalled();
});
it('Changes the start_branch input value', async () => {