diff options
Diffstat (limited to 'spec/frontend/sidebar')
-rw-r--r-- | spec/frontend/sidebar/assignees_spec.js | 4 | ||||
-rw-r--r-- | spec/frontend/sidebar/confidential_issue_sidebar_spec.js | 28 | ||||
-rw-r--r-- | spec/frontend/sidebar/todo_spec.js | 4 |
3 files changed, 24 insertions, 12 deletions
diff --git a/spec/frontend/sidebar/assignees_spec.js b/spec/frontend/sidebar/assignees_spec.js index 4cc91c7ca6e..e29f405adbd 100644 --- a/spec/frontend/sidebar/assignees_spec.js +++ b/spec/frontend/sidebar/assignees_spec.js @@ -65,7 +65,9 @@ describe('Assignee component', () => { jest.spyOn(wrapper.vm, '$emit'); wrapper.find('.assign-yourself .btn-link').trigger('click'); - expect(wrapper.emitted('assign-self')).toBeTruthy(); + return wrapper.vm.$nextTick().then(() => { + expect(wrapper.emitted('assign-self')).toBeTruthy(); + }); }); }); diff --git a/spec/frontend/sidebar/confidential_issue_sidebar_spec.js b/spec/frontend/sidebar/confidential_issue_sidebar_spec.js index 432ec111e52..92c5dc242ee 100644 --- a/spec/frontend/sidebar/confidential_issue_sidebar_spec.js +++ b/spec/frontend/sidebar/confidential_issue_sidebar_spec.js @@ -78,21 +78,29 @@ describe('Confidential Issue Sidebar Block', () => { it('displays the edit form when editable', () => { wrapper.setData({ edit: false }); - wrapper.find({ ref: 'editLink' }).trigger('click'); - - return wrapper.vm.$nextTick().then(() => { - expect(wrapper.find(EditForm).exists()).toBe(true); - }); + return wrapper.vm + .$nextTick() + .then(() => { + wrapper.find({ ref: 'editLink' }).trigger('click'); + return wrapper.vm.$nextTick(); + }) + .then(() => { + expect(wrapper.find(EditForm).exists()).toBe(true); + }); }); it('displays the edit form when opened from collapsed state', () => { wrapper.setData({ edit: false }); - wrapper.find({ ref: 'collapseIcon' }).trigger('click'); - - return wrapper.vm.$nextTick().then(() => { - expect(wrapper.find(EditForm).exists()).toBe(true); - }); + return wrapper.vm + .$nextTick() + .then(() => { + wrapper.find({ ref: 'collapseIcon' }).trigger('click'); + return wrapper.vm.$nextTick(); + }) + .then(() => { + expect(wrapper.find(EditForm).exists()).toBe(true); + }); }); it('tracks the event when "Edit" is clicked', () => { diff --git a/spec/frontend/sidebar/todo_spec.js b/spec/frontend/sidebar/todo_spec.js index 5bbb42d402d..0b323a0c7ef 100644 --- a/spec/frontend/sidebar/todo_spec.js +++ b/spec/frontend/sidebar/todo_spec.js @@ -60,7 +60,9 @@ describe('SidebarTodo', () => { createComponent(); wrapper.find('button').trigger('click'); - expect(wrapper.emitted().toggleTodo).toBeTruthy(); + return wrapper.vm.$nextTick().then(() => { + expect(wrapper.emitted().toggleTodo).toBeTruthy(); + }); }); it('renders component container element with proper data attributes', () => { |