diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
commit | 36a59d088eca61b834191dacea009677a96c052f (patch) | |
tree | e4f33972dab5d8ef79e3944a9f403035fceea43f /spec/frontend/create_cluster/store/cluster_dropdown/mutations_spec.js | |
parent | a1761f15ec2cae7c7f7bbda39a75494add0dfd6f (diff) |
Add latest changes from gitlab-org/gitlab@15-0-stable-eev15.0.0-rc42
Diffstat (limited to 'spec/frontend/create_cluster/store/cluster_dropdown/mutations_spec.js')
-rw-r--r-- | spec/frontend/create_cluster/store/cluster_dropdown/mutations_spec.js | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/spec/frontend/create_cluster/store/cluster_dropdown/mutations_spec.js b/spec/frontend/create_cluster/store/cluster_dropdown/mutations_spec.js deleted file mode 100644 index 197fcfc2600..00000000000 --- a/spec/frontend/create_cluster/store/cluster_dropdown/mutations_spec.js +++ /dev/null @@ -1,36 +0,0 @@ -import { - REQUEST_ITEMS, - RECEIVE_ITEMS_SUCCESS, - RECEIVE_ITEMS_ERROR, -} from '~/create_cluster/store/cluster_dropdown/mutation_types'; -import mutations from '~/create_cluster/store/cluster_dropdown/mutations'; -import createState from '~/create_cluster/store/cluster_dropdown/state'; - -describe('Cluster dropdown store mutations', () => { - let state; - let emptyPayload; - let items; - let error; - - beforeEach(() => { - emptyPayload = {}; - items = [{ name: 'item 1' }]; - error = new Error('could not load error'); - state = createState(); - }); - - it.each` - mutation | mutatedProperty | payload | expectedValue | expectedValueDescription - ${REQUEST_ITEMS} | ${'isLoadingItems'} | ${emptyPayload} | ${true} | ${true} - ${REQUEST_ITEMS} | ${'loadingItemsError'} | ${emptyPayload} | ${null} | ${null} - ${RECEIVE_ITEMS_SUCCESS} | ${'isLoadingItems'} | ${{ items }} | ${false} | ${false} - ${RECEIVE_ITEMS_SUCCESS} | ${'items'} | ${{ items }} | ${items} | ${'items payload'} - ${RECEIVE_ITEMS_ERROR} | ${'isLoadingItems'} | ${{ error }} | ${false} | ${false} - ${RECEIVE_ITEMS_ERROR} | ${'error'} | ${{ error }} | ${error} | ${'received error object'} - `(`$mutation sets $mutatedProperty to $expectedValueDescription`, (data) => { - const { mutation, mutatedProperty, payload, expectedValue } = data; - - mutations[mutation](state, payload); - expect(state[mutatedProperty]).toBe(expectedValue); - }); -}); |