diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-21 12:10:13 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-21 12:10:13 +0300 |
commit | c1cea595b6a9b4d85424e9afd2cb765101ee04bf (patch) | |
tree | b018f6244b8491815f70a7d32ee8087a0f37d1cd /spec/frontend/search | |
parent | 3aca7e52f313182275fea4576c2e0a30483dedb5 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/search')
4 files changed, 12 insertions, 30 deletions
diff --git a/spec/frontend/search/sidebar/components/confidentiality_filter_spec.js b/spec/frontend/search/sidebar/components/confidentiality_filter_spec.js index 1f65884e959..ef7f3359bad 100644 --- a/spec/frontend/search/sidebar/components/confidentiality_filter_spec.js +++ b/spec/frontend/search/sidebar/components/confidentiality_filter_spec.js @@ -1,7 +1,7 @@ import { shallowMount } from '@vue/test-utils'; import Vue from 'vue'; import Vuex from 'vuex'; -import ConfidentialityFilter from '~/search/sidebar/components/confidentiality_filter.vue'; +import ConfidentialityFilter from '~/search/sidebar/components/confidentiality_filter/index.vue'; import RadioFilter from '~/search/sidebar/components/radio_filter.vue'; Vue.use(Vuex); @@ -20,7 +20,6 @@ describe('ConfidentialityFilter', () => { }; const findRadioFilter = () => wrapper.findComponent(RadioFilter); - const findHR = () => wrapper.findComponent('hr'); describe('old sidebar', () => { beforeEach(() => { @@ -30,10 +29,6 @@ describe('ConfidentialityFilter', () => { it('renders the component', () => { expect(findRadioFilter().exists()).toBe(true); }); - - it('renders the divider', () => { - expect(findHR().exists()).toBe(true); - }); }); describe('new sidebar', () => { @@ -44,9 +39,5 @@ describe('ConfidentialityFilter', () => { it('renders the component', () => { expect(findRadioFilter().exists()).toBe(true); }); - - it("doesn't render the divider", () => { - expect(findHR().exists()).toBe(false); - }); }); }); diff --git a/spec/frontend/search/sidebar/components/filters_spec.js b/spec/frontend/search/sidebar/components/filters_spec.js index a92fafd3508..546a84ff040 100644 --- a/spec/frontend/search/sidebar/components/filters_spec.js +++ b/spec/frontend/search/sidebar/components/filters_spec.js @@ -4,8 +4,8 @@ import Vue from 'vue'; import Vuex from 'vuex'; import { MOCK_QUERY } from 'jest/search/mock_data'; import IssuesFilters from '~/search/sidebar/components/issues_filters.vue'; -import ConfidentialityFilter from '~/search/sidebar/components/confidentiality_filter.vue'; -import StatusFilter from '~/search/sidebar/components/status_filter.vue'; +import ConfidentialityFilter from '~/search/sidebar/components/confidentiality_filter/index.vue'; +import StatusFilter from '~/search/sidebar/components/status_filter/index.vue'; Vue.use(Vuex); diff --git a/spec/frontend/search/sidebar/components/radio_filter_spec.js b/spec/frontend/search/sidebar/components/radio_filter_spec.js index 47235b828c3..b5f2b9bb6dd 100644 --- a/spec/frontend/search/sidebar/components/radio_filter_spec.js +++ b/spec/frontend/search/sidebar/components/radio_filter_spec.js @@ -4,8 +4,8 @@ import Vue from 'vue'; import Vuex from 'vuex'; import { MOCK_QUERY } from 'jest/search/mock_data'; import RadioFilter from '~/search/sidebar/components/radio_filter.vue'; -import { confidentialFilterData } from '~/search/sidebar/constants/confidential_filter_data'; -import { stateFilterData } from '~/search/sidebar/constants/state_filter_data'; +import { confidentialFilterData } from '~/search/sidebar/components/confidentiality_filter/data'; +import { statusFilterData } from '~/search/sidebar/components/status_filter/data'; Vue.use(Vuex); @@ -21,7 +21,7 @@ describe('RadioFilter', () => { }; const defaultProps = { - filterData: stateFilterData, + filterData: statusFilterData, }; const createComponent = (initialState, props = {}) => { @@ -60,20 +60,20 @@ describe('RadioFilter', () => { describe('Status Filter', () => { it('renders a radio button for each filterOption', () => { expect(findGlRadioButtonsText()).toStrictEqual( - stateFilterData.filterByScope[stateFilterData.scopes.ISSUES].map((f) => { - return f.value === stateFilterData.filters.ANY.value - ? `Any ${stateFilterData.header.toLowerCase()}` + statusFilterData.filterByScope[statusFilterData.scopes.ISSUES].map((f) => { + return f.value === statusFilterData.filters.ANY.value + ? `Any ${statusFilterData.header.toLowerCase()}` : f.label; }), ); }); it('clicking a radio button item calls setQuery', () => { - const filter = stateFilterData.filters[Object.keys(stateFilterData.filters)[0]].value; + const filter = statusFilterData.filters[Object.keys(statusFilterData.filters)[0]].value; findGlRadioButtonGroup().vm.$emit('input', filter); expect(actionSpies.setQuery).toHaveBeenCalledWith(expect.any(Object), { - key: stateFilterData.filterParam, + key: statusFilterData.filterParam, value: filter, }); }); diff --git a/spec/frontend/search/sidebar/components/status_filter_spec.js b/spec/frontend/search/sidebar/components/status_filter_spec.js index a332a43e624..2cf5ae2a70a 100644 --- a/spec/frontend/search/sidebar/components/status_filter_spec.js +++ b/spec/frontend/search/sidebar/components/status_filter_spec.js @@ -2,7 +2,7 @@ import { shallowMount } from '@vue/test-utils'; import Vue from 'vue'; import Vuex from 'vuex'; import RadioFilter from '~/search/sidebar/components/radio_filter.vue'; -import StatusFilter from '~/search/sidebar/components/status_filter.vue'; +import StatusFilter from '~/search/sidebar/components/status_filter/index.vue'; Vue.use(Vuex); @@ -20,7 +20,6 @@ describe('StatusFilter', () => { }; const findRadioFilter = () => wrapper.findComponent(RadioFilter); - const findHR = () => wrapper.findComponent('hr'); describe('old sidebar', () => { beforeEach(() => { @@ -30,10 +29,6 @@ describe('StatusFilter', () => { it('renders the component', () => { expect(findRadioFilter().exists()).toBe(true); }); - - it('renders the divider', () => { - expect(findHR().exists()).toBe(true); - }); }); describe('new sidebar', () => { @@ -44,9 +39,5 @@ describe('StatusFilter', () => { it('renders the component', () => { expect(findRadioFilter().exists()).toBe(true); }); - - it("doesn't render the divider", () => { - expect(findHR().exists()).toBe(false); - }); }); }); |