diff options
Diffstat (limited to 'spec/frontend/search/sidebar/components/filters_spec.js')
-rw-r--r-- | spec/frontend/search/sidebar/components/filters_spec.js | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/spec/frontend/search/sidebar/components/filters_spec.js b/spec/frontend/search/sidebar/components/filters_spec.js index 4f217709297..7e564bfa005 100644 --- a/spec/frontend/search/sidebar/components/filters_spec.js +++ b/spec/frontend/search/sidebar/components/filters_spec.js @@ -129,4 +129,44 @@ describe('GlobalSearchSidebarFilters', () => { expect(actionSpies.resetQuery).toHaveBeenCalled(); }); }); + + describe.each` + scope | showFilter + ${'issues'} | ${true} + ${'merge_requests'} | ${false} + ${'projects'} | ${false} + ${'milestones'} | ${false} + ${'users'} | ${false} + ${'notes'} | ${false} + ${'wiki_blobs'} | ${false} + ${'blobs'} | ${false} + `(`ConfidentialityFilter`, ({ scope, showFilter }) => { + beforeEach(() => { + createComponent({ urlQuery: { scope } }); + }); + + it(`does${showFilter ? '' : ' not'} render when scope is ${scope}`, () => { + expect(findConfidentialityFilter().exists()).toBe(showFilter); + }); + }); + + describe.each` + scope | showFilter + ${'issues'} | ${true} + ${'merge_requests'} | ${true} + ${'projects'} | ${false} + ${'milestones'} | ${false} + ${'users'} | ${false} + ${'notes'} | ${false} + ${'wiki_blobs'} | ${false} + ${'blobs'} | ${false} + `(`StatusFilter`, ({ scope, showFilter }) => { + beforeEach(() => { + createComponent({ urlQuery: { scope } }); + }); + + it(`does${showFilter ? '' : ' not'} render when scope is ${scope}`, () => { + expect(findStatusFilter().exists()).toBe(showFilter); + }); + }); }); |