diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-16 15:10:54 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-16 15:10:54 +0300 |
commit | f01d3c8c095e70981ffc1d20c050c153f3766421 (patch) | |
tree | 1f072a51c12791df3847fd90bd8e6a369631e990 /spec/frontend/work_items | |
parent | cb20cd86e45ad06b0dc43562c0a1121c3e505c36 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/work_items')
5 files changed, 24 insertions, 16 deletions
diff --git a/spec/frontend/work_items/components/work_item_detail_modal_spec.js b/spec/frontend/work_items/components/work_item_detail_modal_spec.js index 4f7ae4059ee..1bdf5d1c840 100644 --- a/spec/frontend/work_items/components/work_item_detail_modal_spec.js +++ b/spec/frontend/work_items/components/work_item_detail_modal_spec.js @@ -90,7 +90,6 @@ describe('WorkItemDetailModal component', () => { workItemId: defaultPropsData.workItemId, workItemParentId: defaultPropsData.issueGid, workItemIid: null, - modal: null, }); }); 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 d20e5f8d1b3..fe7556f8ec6 100644 --- a/spec/frontend/work_items/components/work_item_detail_spec.js +++ b/spec/frontend/work_items/components/work_item_detail_spec.js @@ -99,7 +99,6 @@ describe('WorkItemDetail component', () => { subscriptionHandler = titleSubscriptionHandler, confidentialityMock = [updateWorkItemMutation, jest.fn()], error = undefined, - workItemsMvcEnabled = false, workItemsMvc2Enabled = false, } = {}) => { const handlers = [ @@ -123,7 +122,6 @@ describe('WorkItemDetail component', () => { }, provide: { glFeatures: { - workItemsMvc: workItemsMvcEnabled, workItemsMvc2: workItemsMvc2Enabled, }, hasIssueWeightsFeature: true, @@ -746,21 +744,10 @@ describe('WorkItemDetail component', () => { }); describe('notes widget', () => { - it('does not render notes by default', async () => { + it('renders notes by default', async () => { createComponent(); await waitForPromises(); - expect(findNotesWidget().exists()).toBe(false); - }); - - it('renders notes when the work_items_mvc flag is on', async () => { - const notesWorkItem = workItemResponseFactory({ - notesWidgetPresent: true, - }); - const handler = jest.fn().mockResolvedValue(notesWorkItem); - createComponent({ workItemsMvcEnabled: true, handler }); - await waitForPromises(); - expect(findNotesWidget().exists()).toBe(true); }); }); diff --git a/spec/frontend/work_items/components/work_item_links/work_item_link_child_spec.js b/spec/frontend/work_items/components/work_item_links/work_item_link_child_spec.js index ca181c346b5..721436e217e 100644 --- a/spec/frontend/work_items/components/work_item_links/work_item_link_child_spec.js +++ b/spec/frontend/work_items/components/work_item_links/work_item_link_child_spec.js @@ -111,6 +111,24 @@ describe('WorkItemLinkChild', () => { expect(titleEl.text()).toBe(workItemTask.title); }); + describe('renders item title correctly for relative instance', () => { + beforeEach(() => { + window.gon = { relative_url_root: '/test' }; + createComponent(); + titleEl = wrapper.findByTestId('item-title'); + }); + + it('renders item title with correct href', () => { + expect(titleEl.attributes('href')).toBe( + '/test/gitlab-org/gitlab-test/-/work_items/4?iid_path=true', + ); + }); + + it('renders item title with correct text', () => { + expect(titleEl.text()).toBe(workItemTask.title); + }); + }); + it.each` action | event | emittedEvent ${'doing mouseover on'} | ${'mouseover'} | ${'mouseover'} @@ -147,6 +165,8 @@ describe('WorkItemLinkChild', () => { expect(metadataEl.props()).toMatchObject({ metadataWidgets: workItemObjectiveMetadataWidgets, }); + + expect(wrapper.find('[data-testid="links-child"]').classes()).toContain('gl-py-3'); }); it('does not render item metadata component when item has no metadata present', () => { @@ -156,6 +176,8 @@ describe('WorkItemLinkChild', () => { }); expect(findMetadataComponent().exists()).toBe(false); + + expect(wrapper.find('[data-testid="links-child"]').classes()).toContain('gl-py-0'); }); }); diff --git a/spec/frontend/work_items/pages/work_item_root_spec.js b/spec/frontend/work_items/pages/work_item_root_spec.js index 39b5e523667..37326910e13 100644 --- a/spec/frontend/work_items/pages/work_item_root_spec.js +++ b/spec/frontend/work_items/pages/work_item_root_spec.js @@ -52,7 +52,6 @@ describe('Work items root component', () => { workItemId: 'gid://gitlab/WorkItem/1', workItemParentId: null, workItemIid: '1', - modal: null, }); }); diff --git a/spec/frontend/work_items/router_spec.js b/spec/frontend/work_items/router_spec.js index 8ebf76d40c8..5dad7f7c43f 100644 --- a/spec/frontend/work_items/router_spec.js +++ b/spec/frontend/work_items/router_spec.js @@ -75,6 +75,7 @@ describe('Work items router', () => { WorkItemWeight: true, WorkItemIteration: true, WorkItemHealthStatus: true, + WorkItemNotes: true, }, }); }; |