diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-12 03:12:55 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-12 03:12:55 +0300 |
commit | 4e65fc3589914bc328539943f1164f4aff2b8d58 (patch) | |
tree | 0bdfcd44063ce9148fc121a2635bc05a6186f0eb /spec/frontend/vue_shared | |
parent | 9643359dd3a54154ecf0cb8efab39599529aa90c (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/vue_shared')
-rw-r--r-- | spec/frontend/vue_shared/issuable/create/components/issuable_label_selector_spec.js | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/spec/frontend/vue_shared/issuable/create/components/issuable_label_selector_spec.js b/spec/frontend/vue_shared/issuable/create/components/issuable_label_selector_spec.js index 679b1f082b4..1a490359040 100644 --- a/spec/frontend/vue_shared/issuable/create/components/issuable_label_selector_spec.js +++ b/spec/frontend/vue_shared/issuable/create/components/issuable_label_selector_spec.js @@ -1,5 +1,4 @@ import { shallowMount } from '@vue/test-utils'; -import { GlIcon } from '@gitlab/ui'; import { mockRegularLabel, mockScopedLabel, @@ -24,8 +23,6 @@ const workspaceType = WORKSPACE_PROJECT; describe('IssuableLabelSelector', () => { let wrapper; - const findTitle = () => wrapper.find('label').text().replace(/\s+/, ' '); - const findLabelIcon = () => wrapper.findComponent(GlIcon); const findAllHiddenInputs = () => wrapper.findAll('input[type="hidden"]'); const findLabelSelector = () => wrapper.findComponent(LabelsSelect); @@ -47,23 +44,11 @@ describe('IssuableLabelSelector', () => { }); }; - const expectTitleWithCount = (count) => { - const title = findTitle(); - - expect(title).toContain(__('Labels')); - expect(title).toContain(count.toString()); - }; - describe('by default', () => { beforeEach(() => { wrapper = createComponent(); }); - it('has the selected labels count', () => { - expectTitleWithCount(0); - expect(findLabelIcon().props('name')).toBe('labels'); - }); - it('has the label selector', () => { expect(findLabelSelector().props()).toMatchObject({ allowLabelRemove, @@ -89,7 +74,6 @@ describe('IssuableLabelSelector', () => { it('passing initial labels applies them to the form', () => { wrapper = createComponent({ initialLabels: [mockRegularLabel, mockScopedLabel] }); - expectTitleWithCount(2); expect(findLabelSelector().props('selectedLabels')).toStrictEqual([ mockRegularLabel, mockScopedLabel, @@ -103,13 +87,11 @@ describe('IssuableLabelSelector', () => { it('updates the selected labels on the `updateSelectedLabels` event', async () => { wrapper = createComponent(); - expectTitleWithCount(0); expect(findLabelSelector().props('selectedLabels')).toStrictEqual([]); expect(findAllHiddenInputs()).toHaveLength(0); await findLabelSelector().vm.$emit('updateSelectedLabels', { labels: [mockRegularLabel] }); - expectTitleWithCount(1); expect(findLabelSelector().props('selectedLabels')).toStrictEqual([mockRegularLabel]); expect(findAllHiddenInputs().wrappers.map((input) => input.element.value)).toStrictEqual([ `${mockRegularLabel.id}`, @@ -119,7 +101,6 @@ describe('IssuableLabelSelector', () => { it('updates the selected labels on the `onLabelRemove` event', async () => { wrapper = createComponent({ initialLabels: [mockRegularLabel] }); - expectTitleWithCount(1); expect(findLabelSelector().props('selectedLabels')).toStrictEqual([mockRegularLabel]); expect(findAllHiddenInputs().wrappers.map((input) => input.element.value)).toStrictEqual([ `${mockRegularLabel.id}`, @@ -127,7 +108,6 @@ describe('IssuableLabelSelector', () => { await findLabelSelector().vm.$emit('onLabelRemove', mockRegularLabel.id); - expectTitleWithCount(0); expect(findLabelSelector().props('selectedLabels')).toStrictEqual([]); expect(findAllHiddenInputs()).toHaveLength(0); }); |