diff options
Diffstat (limited to 'spec/frontend/pipelines/pipelines_spec.js')
-rw-r--r-- | spec/frontend/pipelines/pipelines_spec.js | 45 |
1 files changed, 25 insertions, 20 deletions
diff --git a/spec/frontend/pipelines/pipelines_spec.js b/spec/frontend/pipelines/pipelines_spec.js index b04880b43ae..84a25f42201 100644 --- a/spec/frontend/pipelines/pipelines_spec.js +++ b/spec/frontend/pipelines/pipelines_spec.js @@ -1,4 +1,4 @@ -import { GlButton, GlFilteredSearch, GlLoadingIcon, GlPagination } from '@gitlab/ui'; +import { GlButton, GlEmptyState, GlFilteredSearch, GlLoadingIcon, GlPagination } from '@gitlab/ui'; import { mount } from '@vue/test-utils'; import MockAdapter from 'axios-mock-adapter'; import { chunk } from 'lodash'; @@ -8,8 +8,6 @@ import waitForPromises from 'helpers/wait_for_promises'; import Api from '~/api'; import { deprecatedCreateFlash as createFlash } from '~/flash'; import axios from '~/lib/utils/axios_utils'; -import BlankState from '~/pipelines/components/pipelines_list/blank_state.vue'; -import EmptyState from '~/pipelines/components/pipelines_list/empty_state.vue'; import NavigationControls from '~/pipelines/components/pipelines_list/nav_controls.vue'; import PipelinesComponent from '~/pipelines/components/pipelines_list/pipelines.vue'; import PipelinesTableComponent from '~/pipelines/components/pipelines_list/pipelines_table.vue'; @@ -58,11 +56,10 @@ describe('Pipelines', () => { }; const findFilteredSearch = () => wrapper.findComponent(GlFilteredSearch); + const findEmptyState = () => wrapper.findComponent(GlEmptyState); const findNavigationTabs = () => wrapper.findComponent(NavigationTabs); const findNavigationControls = () => wrapper.findComponent(NavigationControls); const findPipelinesTable = () => wrapper.findComponent(PipelinesTableComponent); - const findEmptyState = () => wrapper.findComponent(EmptyState); - const findBlankState = () => wrapper.findComponent(BlankState); const findTablePagination = () => wrapper.findComponent(TablePagination); const findTab = (tab) => wrapper.findByTestId(`pipelines-tab-${tab}`); @@ -194,16 +191,16 @@ describe('Pipelines', () => { expect(findNavigationControls().exists()).toBe(true); }); - it('renders Run Pipeline link', () => { + it('renders Run pipeline link', () => { expect(findRunPipelineButton().attributes('href')).toBe(paths.newPipelinePath); }); - it('renders CI Lint link', () => { + it('renders CI lint link', () => { expect(findCiLintButton().attributes('href')).toBe(paths.ciLintPath); }); - it('renders Clear Runner Cache button', () => { - expect(findCleanCacheButton().text()).toBe('Clear Runner Caches'); + it('renders Clear runner cache button', () => { + expect(findCleanCacheButton().text()).toBe('Clear runner caches'); }); it('renders pipelines in a table', () => { @@ -268,7 +265,7 @@ describe('Pipelines', () => { }); it('should filter pipelines', async () => { - expect(findBlankState().text()).toBe('There are currently no pipelines.'); + expect(findEmptyState().text()).toBe('There are currently no pipelines.'); }); it('should update browser bar', () => { @@ -502,20 +499,24 @@ describe('Pipelines', () => { expect(findTab('all').text()).toMatchInterpolatedText('All 0'); }); - it('renders Run Pipeline link', () => { + it('renders Run pipeline link', () => { expect(findRunPipelineButton().attributes('href')).toBe(paths.newPipelinePath); }); - it('renders CI Lint link', () => { + it('renders CI lint link', () => { expect(findCiLintButton().attributes('href')).toBe(paths.ciLintPath); }); - it('renders Clear Runner Cache button', () => { - expect(findCleanCacheButton().text()).toBe('Clear Runner Caches'); + it('renders Clear runner cache button', () => { + expect(findCleanCacheButton().text()).toBe('Clear runner caches'); }); it('renders empty state', () => { - expect(findBlankState().text()).toBe('There are currently no pipelines.'); + expect(findEmptyState().text()).toBe('There are currently no pipelines.'); + }); + + it('renders filtered search', () => { + expect(findFilteredSearch().exists()).toBe(true); }); it('renders tab empty state finished scope', async () => { @@ -528,7 +529,7 @@ describe('Pipelines', () => { await waitForPromises(); - expect(findBlankState().text()).toBe('There are currently no finished pipelines.'); + expect(findEmptyState().text()).toBe('There are currently no finished pipelines.'); }); }); @@ -550,6 +551,10 @@ describe('Pipelines', () => { ); }); + it('does not render filtered search', () => { + expect(findFilteredSearch().exists()).toBe(false); + }); + it('does not render tabs nor buttons', () => { expect(findNavigationTabs().exists()).toBe(false); expect(findTab('all').exists()).toBe(false); @@ -599,7 +604,7 @@ describe('Pipelines', () => { }); it('renders empty state', () => { - expect(findBlankState().text()).toBe('There are currently no pipelines.'); + expect(findEmptyState().text()).toBe('There are currently no pipelines.'); }); }); }); @@ -688,7 +693,7 @@ describe('Pipelines', () => { }); it('shows error state', () => { - expect(findBlankState().text()).toBe( + expect(findEmptyState().text()).toBe( 'There was an error fetching the pipelines. Try again in a few moments or contact your support team.', ); }); @@ -709,11 +714,11 @@ describe('Pipelines', () => { expect(findRunPipelineButton().attributes('href')).toBe(paths.newPipelinePath); expect(findCiLintButton().attributes('href')).toBe(paths.ciLintPath); - expect(findCleanCacheButton().text()).toBe('Clear Runner Caches'); + expect(findCleanCacheButton().text()).toBe('Clear runner caches'); }); it('shows error state', () => { - expect(findBlankState().text()).toBe( + expect(findEmptyState().text()).toBe( 'There was an error fetching the pipelines. Try again in a few moments or contact your support team.', ); }); |