diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-20 13:00:54 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-20 13:00:54 +0300 |
commit | 3cccd102ba543e02725d247893729e5c73b38295 (patch) | |
tree | f36a04ec38517f5deaaacb5acc7d949688d1e187 /spec/frontend/clusters_list/components/clusters_empty_state_spec.js | |
parent | 205943281328046ef7b4528031b90fbda70c75ac (diff) |
Add latest changes from gitlab-org/gitlab@14-10-stable-eev14.10.0-rc42
Diffstat (limited to 'spec/frontend/clusters_list/components/clusters_empty_state_spec.js')
-rw-r--r-- | spec/frontend/clusters_list/components/clusters_empty_state_spec.js | 45 |
1 files changed, 5 insertions, 40 deletions
diff --git a/spec/frontend/clusters_list/components/clusters_empty_state_spec.js b/spec/frontend/clusters_list/components/clusters_empty_state_spec.js index fe2189296a6..2c3a224f3c8 100644 --- a/spec/frontend/clusters_list/components/clusters_empty_state_spec.js +++ b/spec/frontend/clusters_list/components/clusters_empty_state_spec.js @@ -1,10 +1,8 @@ -import { GlEmptyState, GlButton } from '@gitlab/ui'; +import { GlEmptyState } from '@gitlab/ui'; import { shallowMountExtended } from 'helpers/vue_test_utils_helper'; import ClustersEmptyState from '~/clusters_list/components/clusters_empty_state.vue'; -import ClusterStore from '~/clusters_list/store'; const clustersEmptyStateImage = 'path/to/svg'; -const addClusterPath = '/path/to/connect/cluster'; const emptyStateHelpText = 'empty state text'; describe('ClustersEmptyStateComponent', () => { @@ -12,52 +10,28 @@ describe('ClustersEmptyStateComponent', () => { const defaultProvideData = { clustersEmptyStateImage, - addClusterPath, }; - const findButton = () => wrapper.findComponent(GlButton); const findEmptyStateText = () => wrapper.findByTestId('clusters-empty-state-text'); - const createWrapper = ({ - provideData = { emptyStateHelpText: null }, - isChildComponent = false, - canAddCluster = true, - } = {}) => { + const createWrapper = ({ provideData = { emptyStateHelpText: null } } = {}) => { wrapper = shallowMountExtended(ClustersEmptyState, { - store: ClusterStore({ canAddCluster }), - propsData: { isChildComponent }, provide: { ...defaultProvideData, ...provideData }, stubs: { GlEmptyState }, }); }; - beforeEach(() => { - createWrapper(); - }); - afterEach(() => { wrapper.destroy(); }); - describe('when the component is loaded independently', () => { - it('should render the action button', () => { - expect(findButton().exists()).toBe(true); - }); - }); - describe('when the help text is not provided', () => { - it('should not render the empty state text', () => { - expect(findEmptyStateText().exists()).toBe(false); - }); - }); - - describe('when the component is loaded as a child component', () => { beforeEach(() => { - createWrapper({ isChildComponent: true }); + createWrapper(); }); - it('should not render the action button', () => { - expect(findButton().exists()).toBe(false); + it('should not render the empty state text', () => { + expect(findEmptyStateText().exists()).toBe(false); }); }); @@ -70,13 +44,4 @@ describe('ClustersEmptyStateComponent', () => { expect(findEmptyStateText().text()).toBe(emptyStateHelpText); }); }); - - describe('when the user cannot add clusters', () => { - beforeEach(() => { - createWrapper({ canAddCluster: false }); - }); - it('should disable the button', () => { - expect(findButton().props('disabled')).toBe(true); - }); - }); }); |