diff options
Diffstat (limited to 'spec/frontend/pipelines/pipeline_multi_actions_spec.js')
-rw-r--r-- | spec/frontend/pipelines/pipeline_multi_actions_spec.js | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/spec/frontend/pipelines/pipeline_multi_actions_spec.js b/spec/frontend/pipelines/pipeline_multi_actions_spec.js index e24d2e51f08..f554166da33 100644 --- a/spec/frontend/pipelines/pipeline_multi_actions_spec.js +++ b/spec/frontend/pipelines/pipeline_multi_actions_spec.js @@ -84,13 +84,22 @@ describe('Pipeline Multi Actions Dropdown', () => { expect(wrapper.vm.artifacts).toEqual(artifacts); }); - it('should render all the provided artifacts', () => { - createComponent({ mockData: { artifacts } }); + it('should render all the provided artifacts when search query is empty', () => { + const searchQuery = ''; + createComponent({ mockData: { searchQuery, artifacts } }); expect(findAllArtifactItems()).toHaveLength(artifacts.length); expect(findEmptyMessage().exists()).toBe(false); }); + it('should render filtered artifacts when search query is not empty', () => { + const searchQuery = 'job-2'; + createComponent({ mockData: { searchQuery, artifacts } }); + + expect(findAllArtifactItems()).toHaveLength(1); + expect(findEmptyMessage().exists()).toBe(false); + }); + it('should render the correct artifact name and path', () => { createComponent({ mockData: { artifacts } }); |