diff options
Diffstat (limited to 'spec/frontend')
8 files changed, 42 insertions, 15 deletions
diff --git a/spec/frontend/clusters/components/knative_domain_editor_spec.js b/spec/frontend/clusters/components/knative_domain_editor_spec.js index 94e34088c85..6514d883c0d 100644 --- a/spec/frontend/clusters/components/knative_domain_editor_spec.js +++ b/spec/frontend/clusters/components/knative_domain_editor_spec.js @@ -79,7 +79,9 @@ describe('KnativeDomainEditor', () => { it('triggers save event and pass current knative hostname', () => { wrapper.find(LoadingButton).vm.$emit('click'); - expect(wrapper.emitted('save')[0]).toEqual([knative.hostname]); + return wrapper.vm.$nextTick().then(() => { + expect(wrapper.emitted('save')[0]).toEqual([knative.hostname]); + }); }); }); diff --git a/spec/frontend/clusters/components/uninstall_application_confirmation_modal_spec.js b/spec/frontend/clusters/components/uninstall_application_confirmation_modal_spec.js index f95bce775c6..c07f6851826 100644 --- a/spec/frontend/clusters/components/uninstall_application_confirmation_modal_spec.js +++ b/spec/frontend/clusters/components/uninstall_application_confirmation_modal_spec.js @@ -35,9 +35,10 @@ describe('UninstallApplicationConfirmationModal', () => { wrapper.find(GlModal).vm.$emit('ok'); }); - it('emits confirm event', () => { - expect(wrapper.emitted('confirm')).toBeTruthy(); - }); + it('emits confirm event', () => + wrapper.vm.$nextTick().then(() => { + expect(wrapper.emitted('confirm')).toBeTruthy(); + })); it('calls track uninstall button click mixin', () => { expect(wrapper.vm.trackUninstallButtonClick).toHaveBeenCalledWith(INGRESS); diff --git a/spec/frontend/clusters/services/crossplane_provider_stack_spec.js b/spec/frontend/clusters/services/crossplane_provider_stack_spec.js index d43dc9333b4..3e5f8de8e7b 100644 --- a/spec/frontend/clusters/services/crossplane_provider_stack_spec.js +++ b/spec/frontend/clusters/services/crossplane_provider_stack_spec.js @@ -70,7 +70,9 @@ describe('CrossplaneProviderStack component', () => { }; createComponent({ crossplane }); findFirstDropdownElement().vm.$emit('click'); - expect(wrapper.emitted().set[0][0].code).toEqual('gcp'); + return wrapper.vm.$nextTick().then(() => { + expect(wrapper.emitted().set[0][0].code).toEqual('gcp'); + }); }); it('renders the correct dropdown text when no stack is selected', () => { diff --git a/spec/frontend/diffs/components/diff_file_header_spec.js b/spec/frontend/diffs/components/diff_file_header_spec.js index d2f537950d1..4f6e771aec8 100644 --- a/spec/frontend/diffs/components/diff_file_header_spec.js +++ b/spec/frontend/diffs/components/diff_file_header_spec.js @@ -126,7 +126,9 @@ describe('DiffFileHeader component', () => { it('when collapseIcon is clicked emits toggleFile', () => { createComponent({ collapsible: true }); findCollapseIcon().vm.$emit('click', new Event('click')); - expect(wrapper.emitted().toggleFile).toBeDefined(); + return wrapper.vm.$nextTick().then(() => { + expect(wrapper.emitted().toggleFile).toBeDefined(); + }); }); it('when other element in header is clicked does not emits toggleFile', () => { @@ -200,7 +202,9 @@ describe('DiffFileHeader component', () => { addMergeRequestButtons: true, }); wrapper.find(EditButton).vm.$emit('showForkMessage'); - expect(wrapper.emitted().showForkMessage).toBeDefined(); + return wrapper.vm.$nextTick().then(() => { + expect(wrapper.emitted().showForkMessage).toBeDefined(); + }); }); it('for mode_changed file mode displays mode changes', () => { diff --git a/spec/frontend/ide/components/jobs/stage_spec.js b/spec/frontend/ide/components/jobs/stage_spec.js index dadf5b4caee..400eabfee6d 100644 --- a/spec/frontend/ide/components/jobs/stage_spec.js +++ b/spec/frontend/ide/components/jobs/stage_spec.js @@ -65,7 +65,9 @@ describe('IDE pipeline stage', () => { .findAll(Item) .at(0) .vm.$emit('clickViewLog', job); - expect(wrapper.emitted().clickViewLog[0][0]).toBe(job); + return wrapper.vm.$nextTick().then(() => { + expect(wrapper.emitted().clickViewLog[0][0]).toBe(job); + }); }); it('renders stage details & icon', () => { diff --git a/spec/frontend/notes/components/discussion_notes_spec.js b/spec/frontend/notes/components/discussion_notes_spec.js index 5ab26d742ca..51c7f45d5b0 100644 --- a/spec/frontend/notes/components/discussion_notes_spec.js +++ b/spec/frontend/notes/components/discussion_notes_spec.js @@ -119,17 +119,26 @@ describe('DiscussionNotes', () => { it('emits deleteNote when first note emits handleDeleteNote', () => { findNoteAtIndex(0).vm.$emit('handleDeleteNote'); - expect(wrapper.emitted().deleteNote).toBeTruthy(); + + return wrapper.vm.$nextTick().then(() => { + expect(wrapper.emitted().deleteNote).toBeTruthy(); + }); }); it('emits startReplying when first note emits startReplying', () => { findNoteAtIndex(0).vm.$emit('startReplying'); - expect(wrapper.emitted().startReplying).toBeTruthy(); + + return wrapper.vm.$nextTick().then(() => { + expect(wrapper.emitted().startReplying).toBeTruthy(); + }); }); it('emits deleteNote when second note emits handleDeleteNote', () => { findNoteAtIndex(1).vm.$emit('handleDeleteNote'); - expect(wrapper.emitted().deleteNote).toBeTruthy(); + + return wrapper.vm.$nextTick().then(() => { + expect(wrapper.emitted().deleteNote).toBeTruthy(); + }); }); }); @@ -142,7 +151,10 @@ describe('DiscussionNotes', () => { it('emits deleteNote when first note emits handleDeleteNote', () => { note.vm.$emit('handleDeleteNote'); - expect(wrapper.emitted().deleteNote).toBeTruthy(); + + return wrapper.vm.$nextTick().then(() => { + expect(wrapper.emitted().deleteNote).toBeTruthy(); + }); }); }); }); diff --git a/spec/frontend/repository/components/last_commit_spec.js b/spec/frontend/repository/components/last_commit_spec.js index 855837d8746..b25045b107b 100644 --- a/spec/frontend/repository/components/last_commit_spec.js +++ b/spec/frontend/repository/components/last_commit_spec.js @@ -118,8 +118,10 @@ describe('Repository last commit component', () => { vm.find('.text-expander').vm.$emit('click'); - expect(vm.find('.commit-row-description').isVisible()).toBe(true); - expect(vm.find('.text-expander').classes('open')).toBe(true); + return vm.vm.$nextTick().then(() => { + expect(vm.find('.commit-row-description').isVisible()).toBe(true); + expect(vm.find('.text-expander').classes('open')).toBe(true); + }); }); it('renders the signature HTML as returned by the backend', () => { diff --git a/spec/frontend/vue_mr_widget/components/states/mr_widget_commit_message_dropdown_spec.js b/spec/frontend/vue_mr_widget/components/states/mr_widget_commit_message_dropdown_spec.js index daf1cc2d98b..d1310515856 100644 --- a/spec/frontend/vue_mr_widget/components/states/mr_widget_commit_message_dropdown_spec.js +++ b/spec/frontend/vue_mr_widget/components/states/mr_widget_commit_message_dropdown_spec.js @@ -56,6 +56,8 @@ describe('Commits message dropdown component', () => { it('should emit a commit title on selecting commit', () => { findFirstDropdownElement().vm.$emit('click'); - expect(wrapper.emitted().input[0]).toEqual(['Update test.txt']); + return wrapper.vm.$nextTick().then(() => { + expect(wrapper.emitted().input[0]).toEqual(['Update test.txt']); + }); }); }); |