diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-20 12:26:25 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-20 12:26:25 +0000 |
commit | a09983ae35713f5a2bbb100981116d31ce99826e (patch) | |
tree | 2ee2af7bd104d57086db360a7e6d8c9d5d43667a /spec/frontend/monitoring/components/empty_state_spec.js | |
parent | 18c5ab32b738c0b6ecb4d0df3994000482f34bd8 (diff) | |
download | gitlab-ce-a09983ae35713f5a2bbb100981116d31ce99826e.tar.gz |
Add latest changes from gitlab-org/gitlab@13-2-stable-ee
Diffstat (limited to 'spec/frontend/monitoring/components/empty_state_spec.js')
-rw-r--r-- | spec/frontend/monitoring/components/empty_state_spec.js | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/spec/frontend/monitoring/components/empty_state_spec.js b/spec/frontend/monitoring/components/empty_state_spec.js index e985e5fb443..abb8b21e9f4 100644 --- a/spec/frontend/monitoring/components/empty_state_spec.js +++ b/spec/frontend/monitoring/components/empty_state_spec.js @@ -1,10 +1,11 @@ import { shallowMount } from '@vue/test-utils'; +import { GlLoadingIcon, GlEmptyState } from '@gitlab/ui'; +import { dashboardEmptyStates } from '~/monitoring/constants'; import EmptyState from '~/monitoring/components/empty_state.vue'; function createComponent(props) { return shallowMount(EmptyState, { propsData: { - ...props, settingsPath: '/settingsPath', clustersPath: '/clustersPath', documentationPath: '/documentationPath', @@ -13,30 +14,40 @@ function createComponent(props) { emptyNoDataSvgPath: '/path/to/no-data.svg', emptyNoDataSmallSvgPath: '/path/to/no-data-small.svg', emptyUnableToConnectSvgPath: '/path/to/unable-to-connect.svg', + ...props, }, }); } describe('EmptyState', () => { + it('shows loading state with a loading icon', () => { + const wrapper = createComponent({ + selectedState: dashboardEmptyStates.LOADING, + }); + + expect(wrapper.find(GlLoadingIcon).exists()).toBe(true); + expect(wrapper.find(GlEmptyState).exists()).toBe(false); + }); + it('shows gettingStarted state', () => { const wrapper = createComponent({ - selectedState: 'gettingStarted', + selectedState: dashboardEmptyStates.GETTING_STARTED, }); expect(wrapper.element).toMatchSnapshot(); }); - it('shows loading state', () => { + it('shows unableToConnect state', () => { const wrapper = createComponent({ - selectedState: 'loading', + selectedState: dashboardEmptyStates.UNABLE_TO_CONNECT, }); expect(wrapper.element).toMatchSnapshot(); }); - it('shows unableToConnect state', () => { + it('shows noData state', () => { const wrapper = createComponent({ - selectedState: 'unableToConnect', + selectedState: dashboardEmptyStates.NO_DATA, }); expect(wrapper.element).toMatchSnapshot(); |