diff options
Diffstat (limited to 'spec/frontend/sidebar/components')
-rw-r--r-- | spec/frontend/sidebar/components/assignees/assignees_spec.js | 12 | ||||
-rw-r--r-- | spec/frontend/sidebar/components/copy/sidebar_reference_widget_spec.js | 2 |
2 files changed, 8 insertions, 6 deletions
diff --git a/spec/frontend/sidebar/components/assignees/assignees_spec.js b/spec/frontend/sidebar/components/assignees/assignees_spec.js index 6971ae2f9ed..d422292ed9e 100644 --- a/spec/frontend/sidebar/components/assignees/assignees_spec.js +++ b/spec/frontend/sidebar/components/assignees/assignees_spec.js @@ -1,10 +1,10 @@ import { GlIcon } from '@gitlab/ui'; import { mount } from '@vue/test-utils'; -import { nextTick } from 'vue'; import { trimText } from 'helpers/text_helper'; import UsersMockHelper from 'helpers/user_mock_data_helper'; import Assignee from '~/sidebar/components/assignees/assignees.vue'; import AssigneeAvatarLink from '~/sidebar/components/assignees/assignee_avatar_link.vue'; +import CollapsedAssigneeList from '~/sidebar/components/assignees/collapsed_assignee_list.vue'; import UsersMock from '../../mock_data'; describe('Assignee component', () => { @@ -66,10 +66,8 @@ describe('Assignee component', () => { editable: true, }); - jest.spyOn(wrapper.vm, '$emit'); - wrapper.find('[data-testid="assign-yourself"]').trigger('click'); + await wrapper.find('[data-testid="assign-yourself"]').trigger('click'); - await nextTick(); expect(wrapper.emitted('assign-self')).toHaveLength(1); }); }); @@ -166,7 +164,11 @@ describe('Assignee component', () => { editable: true, }); - expect(wrapper.vm.sortedAssigness[0].can_merge).toBe(true); + expect(wrapper.findComponent(CollapsedAssigneeList).props('users')[0]).toEqual( + expect.objectContaining({ + can_merge: true, + }), + ); }); it('passes the sorted assignees to the uncollapsed-assignee-list', () => { diff --git a/spec/frontend/sidebar/components/copy/sidebar_reference_widget_spec.js b/spec/frontend/sidebar/components/copy/sidebar_reference_widget_spec.js index c5161a748a9..40f14d581dc 100644 --- a/spec/frontend/sidebar/components/copy/sidebar_reference_widget_spec.js +++ b/spec/frontend/sidebar/components/copy/sidebar_reference_widget_spec.js @@ -66,7 +66,7 @@ describe('Sidebar Reference Widget', () => { }); describe('when error occurs', () => { - it('calls createFlash with correct parameters', async () => { + it(`emits 'fetch-error' event with correct parameters`, async () => { const mockError = new Error('mayday'); createComponent({ |