diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-18 06:09:24 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-18 06:09:24 +0000 |
commit | f6d22c8ba7c3f900a3843b1336e2ade1d8d90c1f (patch) | |
tree | ba59e71d8b7e491c32017b94ab6e2392582fc272 /spec/frontend | |
parent | 14facaa466ed56cd0dfad8c0f821ea32f94f94a0 (diff) | |
download | gitlab-ce-f6d22c8ba7c3f900a3843b1336e2ade1d8d90c1f.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend')
-rw-r--r-- | spec/frontend/work_items/components/work_item_detail_spec.js | 19 | ||||
-rw-r--r-- | spec/frontend/work_items/router_spec.js | 4 |
2 files changed, 10 insertions, 13 deletions
diff --git a/spec/frontend/work_items/components/work_item_detail_spec.js b/spec/frontend/work_items/components/work_item_detail_spec.js index 96f1c5275b2..3580842fc1a 100644 --- a/spec/frontend/work_items/components/work_item_detail_spec.js +++ b/spec/frontend/work_items/components/work_item_detail_spec.js @@ -81,7 +81,6 @@ describe('WorkItemDetail component', () => { handler = successHandler, subscriptionHandler = titleSubscriptionHandler, confidentialityMock = [updateWorkItemMutation, jest.fn()], - workItemsMvc2Enabled = false, error = undefined, } = {}) => { const handlers = [ @@ -102,9 +101,6 @@ describe('WorkItemDetail component', () => { }; }, provide: { - glFeatures: { - workItemsMvc2: workItemsMvc2Enabled, - }, hasIssueWeightsFeature: true, hasIterationsFeature: true, projectNamespace: 'namespace', @@ -435,7 +431,7 @@ describe('WorkItemDetail component', () => { it('does not call the assignees subscription', async () => { const response = workItemResponseFactory({ assigneesWidgetPresent: false }); const handler = jest.fn().mockResolvedValue(response); - createComponent({ handler, workItemsMvc2Enabled: true }); + createComponent({ handler }); await waitForPromises(); expect(assigneesSubscriptionHandler).not.toHaveBeenCalled(); @@ -459,7 +455,7 @@ describe('WorkItemDetail component', () => { it('does not call the dates subscription', async () => { const response = workItemResponseFactory({ datesWidgetPresent: false }); const handler = jest.fn().mockResolvedValue(response); - createComponent({ handler, workItemsMvc2Enabled: true }); + createComponent({ handler }); await waitForPromises(); expect(datesSubscriptionHandler).not.toHaveBeenCalled(); @@ -470,9 +466,7 @@ describe('WorkItemDetail component', () => { describe('assignees widget', () => { it('renders assignees component when widget is returned from the API', async () => { - createComponent({ - workItemsMvc2Enabled: true, - }); + createComponent(); await waitForPromises(); expect(findWorkItemAssignees().exists()).toBe(true); @@ -480,7 +474,6 @@ describe('WorkItemDetail component', () => { it('does not render assignees component when widget is not returned from the API', async () => { createComponent({ - workItemsMvc2Enabled: true, handler: jest .fn() .mockResolvedValue(workItemResponseFactory({ assigneesWidgetPresent: false })), @@ -499,7 +492,7 @@ describe('WorkItemDetail component', () => { `('$description', async ({ labelsWidgetPresent, exists }) => { const response = workItemResponseFactory({ labelsWidgetPresent }); const handler = jest.fn().mockResolvedValue(response); - createComponent({ handler, workItemsMvc2Enabled: true }); + createComponent({ handler }); await waitForPromises(); expect(findWorkItemLabels().exists()).toBe(exists); @@ -515,7 +508,7 @@ describe('WorkItemDetail component', () => { it(`${datesWidgetPresent ? 'renders' : 'does not render'} due date component`, async () => { const response = workItemResponseFactory({ datesWidgetPresent }); const handler = jest.fn().mockResolvedValue(response); - createComponent({ handler, workItemsMvc2Enabled: true }); + createComponent({ handler }); await waitForPromises(); expect(findWorkItemDueDate().exists()).toBe(exists); @@ -523,7 +516,7 @@ describe('WorkItemDetail component', () => { }); it('shows an error message when it emits an `error` event', async () => { - createComponent({ workItemsMvc2Enabled: true }); + createComponent(); await waitForPromises(); const updateError = 'Failed to update'; diff --git a/spec/frontend/work_items/router_spec.js b/spec/frontend/work_items/router_spec.js index 39e8eb837c0..66a917d8052 100644 --- a/spec/frontend/work_items/router_spec.js +++ b/spec/frontend/work_items/router_spec.js @@ -9,12 +9,14 @@ import { workItemResponseFactory, workItemTitleSubscriptionResponse, workItemWeightSubscriptionResponse, + workItemLabelsSubscriptionResponse, } from 'jest/work_items/mock_data'; import App from '~/work_items/components/app.vue'; import workItemQuery from '~/work_items/graphql/work_item.query.graphql'; import workItemDatesSubscription from '~/work_items/graphql/work_item_dates.subscription.graphql'; import workItemTitleSubscription from '~/work_items/graphql/work_item_title.subscription.graphql'; import workItemAssigneesSubscription from '~/work_items/graphql/work_item_assignees.subscription.graphql'; +import workItemLabelsSubscription from 'ee_else_ce/work_items/graphql/work_item_labels.subscription.graphql'; import CreateWorkItem from '~/work_items/pages/create_work_item.vue'; import WorkItemsRoot from '~/work_items/pages/work_item_root.vue'; import { createRouter } from '~/work_items/router'; @@ -31,6 +33,7 @@ describe('Work items router', () => { const assigneesSubscriptionHandler = jest .fn() .mockResolvedValue(workItemAssigneesSubscriptionResponse); + const labelsSubscriptionHandler = jest.fn().mockResolvedValue(workItemLabelsSubscriptionResponse); const createComponent = async (routeArg) => { const router = createRouter('/work_item'); @@ -43,6 +46,7 @@ describe('Work items router', () => { [workItemDatesSubscription, datesSubscriptionHandler], [workItemTitleSubscription, titleSubscriptionHandler], [workItemAssigneesSubscription, assigneesSubscriptionHandler], + [workItemLabelsSubscription, labelsSubscriptionHandler], ]; if (IS_EE) { |