diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-27 03:07:50 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-27 03:07:50 +0300 |
commit | 431b84710e87a649de02d398568804f820e3b0fe (patch) | |
tree | 9cbc49a395615412c152d2bffa9255a3b37fafed /spec/frontend/search/store/mutations_spec.js | |
parent | e04b8c1e60649802ae4249dae7fa7aaf3f0a83c7 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/search/store/mutations_spec.js')
-rw-r--r-- | spec/frontend/search/store/mutations_spec.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/frontend/search/store/mutations_spec.js b/spec/frontend/search/store/mutations_spec.js index a79ec8f70b0..d604cf38f8f 100644 --- a/spec/frontend/search/store/mutations_spec.js +++ b/spec/frontend/search/store/mutations_spec.js @@ -8,6 +8,7 @@ import { MOCK_NAVIGATION_DATA, MOCK_NAVIGATION_ACTION_MUTATION, MOCK_DATA_FOR_NAVIGATION_ACTION_MUTATION, + MOCK_AGGREGATIONS, } from '../mock_data'; describe('Global Search Store Mutations', () => { @@ -108,4 +109,17 @@ describe('Global Search Store Mutations', () => { ); }); }); + + describe.each` + mutation | data | result + ${types.REQUEST_AGGREGATIONS} | ${[]} | ${{ fetching: true, error: false, data: [] }} + ${types.RECEIVE_AGGREGATIONS_SUCCESS} | ${MOCK_AGGREGATIONS} | ${{ fetching: false, error: false, data: MOCK_AGGREGATIONS }} + ${types.RECEIVE_AGGREGATIONS_ERROR} | ${[]} | ${{ fetching: false, error: true, data: [] }} + `('$mutation', ({ mutation, data, result }) => { + it('sets correct object content', () => { + mutations[mutation](state, data); + + expect(state.aggregations).toStrictEqual(result); + }); + }); }); |