diff options
Diffstat (limited to 'spec/frontend/pipelines/pipeline_multi_actions_spec.js')
-rw-r--r-- | spec/frontend/pipelines/pipeline_multi_actions_spec.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/frontend/pipelines/pipeline_multi_actions_spec.js b/spec/frontend/pipelines/pipeline_multi_actions_spec.js index 88b3ef2032a..ce33b6011bf 100644 --- a/spec/frontend/pipelines/pipeline_multi_actions_spec.js +++ b/spec/frontend/pipelines/pipeline_multi_actions_spec.js @@ -53,6 +53,7 @@ describe('Pipeline Multi Actions Dropdown', () => { const findDropdown = () => wrapper.findComponent(GlDropdown); const findAllArtifactItems = () => wrapper.findAllByTestId(artifactItemTestId); const findFirstArtifactItem = () => wrapper.findByTestId(artifactItemTestId); + const findEmptyMessage = () => wrapper.findByTestId('artifacts-empty-message'); beforeEach(() => { mockAxios = new MockAdapter(axios); @@ -86,6 +87,7 @@ describe('Pipeline Multi Actions Dropdown', () => { createComponent({ mockData: { artifacts } }); expect(findAllArtifactItems()).toHaveLength(artifacts.length); + expect(findEmptyMessage().exists()).toBe(false); }); it('should render the correct artifact name and path', () => { @@ -95,6 +97,12 @@ describe('Pipeline Multi Actions Dropdown', () => { expect(findFirstArtifactItem().text()).toBe(`Download ${artifacts[0].name} artifact`); }); + it('should render empty message when no artifacts are found', () => { + createComponent({ mockData: { artifacts: [] } }); + + expect(findEmptyMessage().exists()).toBe(true); + }); + describe('with a failing request', () => { it('should render an error message', async () => { const endpoint = artifactsEndpoint.replace(artifactsEndpointPlaceholder, pipelineId); |