Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-10-03 18:10:59 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-10-03 18:10:59 +0300
commit2f08c2b7d2cd32d0791986958d3242673ff037a9 (patch)
tree7424040bd1bfaf5455fb7e21dd4a25a5b513dc6b /spec/frontend/search
parentd9ec4caf8fe4a4315e8e09e48d3ec79fd0a724c5 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/search')
-rw-r--r--spec/frontend/search/sidebar/components/archived_filter_spec.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/frontend/search/sidebar/components/archived_filter_spec.js b/spec/frontend/search/sidebar/components/archived_filter_spec.js
index 69bf2ebd72e..a4c1f3b758f 100644
--- a/spec/frontend/search/sidebar/components/archived_filter_spec.js
+++ b/spec/frontend/search/sidebar/components/archived_filter_spec.js
@@ -12,9 +12,14 @@ Vue.use(Vuex);
describe('ArchivedFilter', () => {
let wrapper;
+ const defaultActions = {
+ setQuery: jest.fn(),
+ };
+
const createComponent = (state) => {
const store = new Vuex.Store({
state,
+ actions: defaultActions,
});
wrapper = shallowMount(ArchivedFilter, {
@@ -70,4 +75,20 @@ describe('ArchivedFilter', () => {
expect(findCheckboxFilter().attributes('checked')).toBe(checkboxState);
});
});
+
+ describe('selectedFilter logic', () => {
+ beforeEach(() => {
+ createComponent();
+ });
+
+ it('correctly executes setQuery without mutating the input', () => {
+ const selectedFilter = [false];
+ findCheckboxFilter().vm.$emit('input', selectedFilter);
+ expect(defaultActions.setQuery).toHaveBeenCalledWith(expect.any(Object), {
+ key: 'include_archived',
+ value: 'false',
+ });
+ expect(selectedFilter).toEqual([false]);
+ });
+ });
});