diff options
Diffstat (limited to 'spec/frontend/sidebar/components/labels/labels_select_widget/labels_select_root_spec.js')
-rw-r--r-- | spec/frontend/sidebar/components/labels/labels_select_widget/labels_select_root_spec.js | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/spec/frontend/sidebar/components/labels/labels_select_widget/labels_select_root_spec.js b/spec/frontend/sidebar/components/labels/labels_select_widget/labels_select_root_spec.js index fd8e72bac49..3101fd90f2e 100644 --- a/spec/frontend/sidebar/components/labels/labels_select_widget/labels_select_root_spec.js +++ b/spec/frontend/sidebar/components/labels/labels_select_widget/labels_select_root_spec.js @@ -3,8 +3,8 @@ import Vue, { nextTick } from 'vue'; import VueApollo from 'vue-apollo'; import createMockApollo from 'helpers/mock_apollo_helper'; import waitForPromises from 'helpers/wait_for_promises'; -import { createAlert } from '~/flash'; -import { IssuableType, TYPE_EPIC, TYPE_ISSUE } from '~/issues/constants'; +import { createAlert } from '~/alert'; +import { TYPE_EPIC, TYPE_ISSUE, TYPE_MERGE_REQUEST, TYPE_TEST_CASE } from '~/issues/constants'; import SidebarEditableItem from '~/sidebar/components/sidebar_editable_item.vue'; import DropdownContents from '~/sidebar/components/labels/labels_select_widget/dropdown_contents.vue'; import DropdownValue from '~/sidebar/components/labels/labels_select_widget/dropdown_value.vue'; @@ -25,7 +25,7 @@ import { mockRegularLabel, } from './mock_data'; -jest.mock('~/flash'); +jest.mock('~/alert'); Vue.use(VueApollo); @@ -36,9 +36,9 @@ const errorQueryHandler = jest.fn().mockRejectedValue('Houston, we have a proble const updateLabelsMutation = { [TYPE_ISSUE]: updateIssueLabelsMutation, - [IssuableType.MergeRequest]: updateMergeRequestLabelsMutation, + [TYPE_MERGE_REQUEST]: updateMergeRequestLabelsMutation, [TYPE_EPIC]: updateEpicLabelsMutation, - [IssuableType.TestCase]: updateTestCaseLabelsMutation, + [TYPE_TEST_CASE]: updateTestCaseLabelsMutation, }; describe('LabelsSelectRoot', () => { @@ -83,10 +83,6 @@ describe('LabelsSelectRoot', () => { }); }; - afterEach(() => { - wrapper.destroy(); - }); - it('renders component with classes `labels-select-wrapper gl-relative`', () => { createComponent(); expect(wrapper.classes()).toEqual(['labels-select-wrapper', 'gl-relative']); @@ -150,7 +146,7 @@ describe('LabelsSelectRoot', () => { }); }); - it('creates flash with error message when query is rejected', async () => { + it('creates alert with error message when query is rejected', async () => { createComponent({ queryHandler: errorQueryHandler }); await waitForPromises(); expect(createAlert).toHaveBeenCalledWith({ message: 'Error fetching labels.' }); @@ -214,9 +210,9 @@ describe('LabelsSelectRoot', () => { describe.each` issuableType ${TYPE_ISSUE} - ${IssuableType.MergeRequest} + ${TYPE_MERGE_REQUEST} ${TYPE_EPIC} - ${IssuableType.TestCase} + ${TYPE_TEST_CASE} `('when updating labels for $issuableType', ({ issuableType }) => { const label = { id: 'gid://gitlab/ProjectLabel/2' }; |