diff options
Diffstat (limited to 'spec/frontend/diffs')
3 files changed, 26 insertions, 8 deletions
diff --git a/spec/frontend/diffs/components/diff_file_header_spec.js b/spec/frontend/diffs/components/diff_file_header_spec.js index f2d07d3d4b2..d2f537950d1 100644 --- a/spec/frontend/diffs/components/diff_file_header_spec.js +++ b/spec/frontend/diffs/components/diff_file_header_spec.js @@ -117,7 +117,10 @@ describe('DiffFileHeader component', () => { it('when header is clicked emits toggleFile', () => { createComponent(); findHeader().trigger('click'); - expect(wrapper.emitted().toggleFile).toBeDefined(); + + return wrapper.vm.$nextTick().then(() => { + expect(wrapper.emitted().toggleFile).toBeDefined(); + }); }); it('when collapseIcon is clicked emits toggleFile', () => { @@ -129,7 +132,10 @@ describe('DiffFileHeader component', () => { it('when other element in header is clicked does not emits toggleFile', () => { createComponent({ collapsible: true }); findTitleLink().trigger('click'); - expect(wrapper.emitted().toggleFile).not.toBeDefined(); + + return wrapper.vm.$nextTick().then(() => { + expect(wrapper.emitted().toggleFile).not.toBeDefined(); + }); }); it('displays a copy to clipboard button', () => { diff --git a/spec/frontend/diffs/components/diff_gutter_avatars_spec.js b/spec/frontend/diffs/components/diff_gutter_avatars_spec.js index b2debe36b89..eb9effea736 100644 --- a/spec/frontend/diffs/components/diff_gutter_avatars_spec.js +++ b/spec/frontend/diffs/components/diff_gutter_avatars_spec.js @@ -42,7 +42,9 @@ describe('DiffGutterAvatars', () => { it('should emit toggleDiscussions event on button click', () => { findCollapseButton().trigger('click'); - expect(wrapper.emitted().toggleLineDiscussions).toBeTruthy(); + return wrapper.vm.$nextTick().then(() => { + expect(wrapper.emitted().toggleLineDiscussions).toBeTruthy(); + }); }); }); @@ -72,13 +74,17 @@ describe('DiffGutterAvatars', () => { .at(0) .trigger('click'); - expect(wrapper.emitted().toggleLineDiscussions).toBeTruthy(); + return wrapper.vm.$nextTick().then(() => { + expect(wrapper.emitted().toggleLineDiscussions).toBeTruthy(); + }); }); it('should emit toggleDiscussions event on more count text click', () => { findMoreCount().trigger('click'); - expect(wrapper.emitted().toggleLineDiscussions).toBeTruthy(); + return wrapper.vm.$nextTick().then(() => { + expect(wrapper.emitted().toggleLineDiscussions).toBeTruthy(); + }); }); }); diff --git a/spec/frontend/diffs/components/edit_button_spec.js b/spec/frontend/diffs/components/edit_button_spec.js index 4e2cfc75212..fc53f26bd42 100644 --- a/spec/frontend/diffs/components/edit_button_spec.js +++ b/spec/frontend/diffs/components/edit_button_spec.js @@ -36,7 +36,9 @@ describe('EditButton', () => { }); wrapper.trigger('click'); - expect(wrapper.emitted('showForkMessage')).toBeTruthy(); + return wrapper.vm.$nextTick().then(() => { + expect(wrapper.emitted('showForkMessage')).toBeTruthy(); + }); }); it('doesnt emit a show fork message event if current user cannot fork', () => { @@ -46,7 +48,9 @@ describe('EditButton', () => { }); wrapper.trigger('click'); - expect(wrapper.emitted('showForkMessage')).toBeFalsy(); + return wrapper.vm.$nextTick().then(() => { + expect(wrapper.emitted('showForkMessage')).toBeFalsy(); + }); }); it('doesnt emit a show fork message event if current user can modify blob', () => { @@ -57,6 +61,8 @@ describe('EditButton', () => { }); wrapper.trigger('click'); - expect(wrapper.emitted('showForkMessage')).toBeFalsy(); + return wrapper.vm.$nextTick().then(() => { + expect(wrapper.emitted('showForkMessage')).toBeFalsy(); + }); }); }); |