diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-21 18:15:17 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-21 18:15:17 +0000 |
commit | 248492cc573e85aea19d7493c3a15d459be016c5 (patch) | |
tree | c25388f4af2e9a87e06121318982001b964e7573 /spec/frontend/work_items/components | |
parent | 97a128c1d1bf45bcc00d5fae037f840eff1ae4e0 (diff) | |
download | gitlab-ce-248492cc573e85aea19d7493c3a15d459be016c5.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/work_items/components')
-rw-r--r-- | spec/frontend/work_items/components/work_item_links/work_item_link_child_metadata_spec.js | 19 | ||||
-rw-r--r-- | spec/frontend/work_items/components/work_item_links/work_item_link_child_spec.js | 20 |
2 files changed, 18 insertions, 21 deletions
diff --git a/spec/frontend/work_items/components/work_item_links/work_item_link_child_metadata_spec.js b/spec/frontend/work_items/components/work_item_links/work_item_link_child_metadata_spec.js index e693ccfb156..07efb1c5ac8 100644 --- a/spec/frontend/work_items/components/work_item_links/work_item_link_child_metadata_spec.js +++ b/spec/frontend/work_items/components/work_item_links/work_item_link_child_metadata_spec.js @@ -1,4 +1,4 @@ -import { GlLabel, GlAvatarsInline } from '@gitlab/ui'; +import { GlAvatarsInline } from '@gitlab/ui'; import { shallowMountExtended } from 'helpers/vue_test_utils_helper'; @@ -8,10 +8,9 @@ import WorkItemLinkChildMetadata from '~/work_items/components/work_item_links/w import { workItemObjectiveMetadataWidgets } from '../../mock_data'; describe('WorkItemLinkChildMetadata', () => { - const { MILESTONE, ASSIGNEES, LABELS } = workItemObjectiveMetadataWidgets; + const { MILESTONE, ASSIGNEES } = workItemObjectiveMetadataWidgets; const mockMilestone = MILESTONE.milestone; const mockAssignees = ASSIGNEES.assignees.nodes; - const mockLabels = LABELS.labels.nodes; let wrapper; const createComponent = ({ metadataWidgets = workItemObjectiveMetadataWidgets } = {}) => { @@ -53,18 +52,4 @@ describe('WorkItemLinkChildMetadata', () => { badgeSrOnlyText: '', }); }); - - it('renders labels', () => { - const labels = wrapper.findAllComponents(GlLabel); - const mockLabel = mockLabels[0]; - - expect(labels).toHaveLength(mockLabels.length); - expect(labels.at(0).props()).toMatchObject({ - title: mockLabel.title, - backgroundColor: mockLabel.color, - description: mockLabel.description, - scoped: false, - }); - expect(labels.at(1).props('scoped')).toBe(true); // Second label is scoped - }); }); 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 721436e217e..4fef5c0b91e 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 @@ -1,4 +1,4 @@ -import { GlIcon } from '@gitlab/ui'; +import { GlLabel, GlIcon } from '@gitlab/ui'; import Vue from 'vue'; import VueApollo from 'vue-apollo'; import createMockApollo from 'helpers/mock_apollo_helper'; @@ -37,6 +37,8 @@ describe('WorkItemLinkChild', () => { const WORK_ITEM_ID = 'gid://gitlab/WorkItem/2'; let wrapper; let getWorkItemTreeQueryHandler; + const { LABELS } = workItemObjectiveMetadataWidgets; + const mockLabels = LABELS.labels.nodes; Vue.use(VueApollo); @@ -165,8 +167,6 @@ 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', () => { @@ -176,8 +176,20 @@ describe('WorkItemLinkChild', () => { }); expect(findMetadataComponent().exists()).toBe(false); + }); - expect(wrapper.find('[data-testid="links-child"]').classes()).toContain('gl-py-0'); + it('renders labels', () => { + const labels = wrapper.findAllComponents(GlLabel); + const mockLabel = mockLabels[0]; + + expect(labels).toHaveLength(mockLabels.length); + expect(labels.at(0).props()).toMatchObject({ + title: mockLabel.title, + backgroundColor: mockLabel.color, + description: mockLabel.description, + scoped: false, + }); + expect(labels.at(1).props('scoped')).toBe(true); // Second label is scoped }); }); |