diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-18 16:16:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-18 16:16:36 +0300 |
commit | 311b0269b4eb9839fa63f80c8d7a58f32b8138a0 (patch) | |
tree | 07e7870bca8aed6d61fdcc810731c50d2c40af47 /spec/frontend/packages/list/components/packages_title_spec.js | |
parent | 27909cef6c4170ed9205afa7426b8d3de47cbb0c (diff) |
Add latest changes from gitlab-org/gitlab@14-5-stable-eev14.5.0-rc42
Diffstat (limited to 'spec/frontend/packages/list/components/packages_title_spec.js')
-rw-r--r-- | spec/frontend/packages/list/components/packages_title_spec.js | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/spec/frontend/packages/list/components/packages_title_spec.js b/spec/frontend/packages/list/components/packages_title_spec.js deleted file mode 100644 index a17f72e3133..00000000000 --- a/spec/frontend/packages/list/components/packages_title_spec.js +++ /dev/null @@ -1,71 +0,0 @@ -import { shallowMount } from '@vue/test-utils'; -import { LIST_INTRO_TEXT, LIST_TITLE_TEXT } from '~/packages/list//constants'; -import PackageTitle from '~/packages/list/components/package_title.vue'; -import MetadataItem from '~/vue_shared/components/registry/metadata_item.vue'; -import TitleArea from '~/vue_shared/components/registry/title_area.vue'; - -describe('PackageTitle', () => { - let wrapper; - let store; - - const findTitleArea = () => wrapper.find(TitleArea); - const findMetadataItem = () => wrapper.find(MetadataItem); - - const mountComponent = (propsData = { helpUrl: 'foo' }) => { - wrapper = shallowMount(PackageTitle, { - store, - propsData, - stubs: { - TitleArea, - }, - }); - }; - - afterEach(() => { - wrapper.destroy(); - wrapper = null; - }); - - describe('title area', () => { - it('exists', () => { - mountComponent(); - - expect(findTitleArea().exists()).toBe(true); - }); - - it('has the correct props', () => { - mountComponent(); - - expect(findTitleArea().props()).toMatchObject({ - title: LIST_TITLE_TEXT, - infoMessages: [{ text: LIST_INTRO_TEXT, link: 'foo' }], - }); - }); - }); - - describe.each` - count | exist | text - ${null} | ${false} | ${''} - ${undefined} | ${false} | ${''} - ${0} | ${true} | ${'0 Packages'} - ${1} | ${true} | ${'1 Package'} - ${2} | ${true} | ${'2 Packages'} - `('when count is $count metadata item', ({ count, exist, text }) => { - beforeEach(() => { - mountComponent({ count, helpUrl: 'foo' }); - }); - - it(`is ${exist} that it exists`, () => { - expect(findMetadataItem().exists()).toBe(exist); - }); - - if (exist) { - it('has the correct props', () => { - expect(findMetadataItem().props()).toMatchObject({ - icon: 'package', - text, - }); - }); - } - }); -}); |