diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-20 17:34:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-20 17:34:42 +0300 |
commit | 9f46488805e86b1bc341ea1620b866016c2ce5ed (patch) | |
tree | f9748c7e287041e37d6da49e0a29c9511dc34768 /spec/frontend/static_site_editor/store/mutations_spec.js | |
parent | dfc92d081ea0332d69c8aca2f0e745cb48ae5e6d (diff) |
Add latest changes from gitlab-org/gitlab@13-0-stable-ee
Diffstat (limited to 'spec/frontend/static_site_editor/store/mutations_spec.js')
-rw-r--r-- | spec/frontend/static_site_editor/store/mutations_spec.js | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/spec/frontend/static_site_editor/store/mutations_spec.js b/spec/frontend/static_site_editor/store/mutations_spec.js deleted file mode 100644 index 2441f317d90..00000000000 --- a/spec/frontend/static_site_editor/store/mutations_spec.js +++ /dev/null @@ -1,54 +0,0 @@ -import createState from '~/static_site_editor/store/state'; -import mutations from '~/static_site_editor/store/mutations'; -import * as types from '~/static_site_editor/store/mutation_types'; -import { - sourceContentTitle as title, - sourceContent as content, - savedContentMeta, - submitChangesError, -} from '../mock_data'; - -describe('Static Site Editor Store mutations', () => { - let state; - const contentLoadedPayload = { title, content }; - - beforeEach(() => { - state = createState(); - }); - - it.each` - mutation | stateProperty | payload | expectedValue - ${types.LOAD_CONTENT} | ${'isLoadingContent'} | ${undefined} | ${true} - ${types.RECEIVE_CONTENT_SUCCESS} | ${'isLoadingContent'} | ${contentLoadedPayload} | ${false} - ${types.RECEIVE_CONTENT_SUCCESS} | ${'isContentLoaded'} | ${contentLoadedPayload} | ${true} - ${types.RECEIVE_CONTENT_SUCCESS} | ${'title'} | ${contentLoadedPayload} | ${title} - ${types.RECEIVE_CONTENT_SUCCESS} | ${'content'} | ${contentLoadedPayload} | ${content} - ${types.RECEIVE_CONTENT_SUCCESS} | ${'originalContent'} | ${contentLoadedPayload} | ${content} - ${types.RECEIVE_CONTENT_ERROR} | ${'isLoadingContent'} | ${undefined} | ${false} - ${types.SET_CONTENT} | ${'content'} | ${content} | ${content} - ${types.SUBMIT_CHANGES} | ${'isSavingChanges'} | ${undefined} | ${true} - ${types.SUBMIT_CHANGES_SUCCESS} | ${'savedContentMeta'} | ${savedContentMeta} | ${savedContentMeta} - ${types.SUBMIT_CHANGES_SUCCESS} | ${'isSavingChanges'} | ${savedContentMeta} | ${false} - ${types.SUBMIT_CHANGES_ERROR} | ${'isSavingChanges'} | ${undefined} | ${false} - ${types.SUBMIT_CHANGES_ERROR} | ${'submitChangesError'} | ${submitChangesError} | ${submitChangesError} - ${types.DISMISS_SUBMIT_CHANGES_ERROR} | ${'submitChangesError'} | ${undefined} | ${''} - `( - '$mutation sets $stateProperty to $expectedValue', - ({ mutation, stateProperty, payload, expectedValue }) => { - mutations[mutation](state, payload); - expect(state[stateProperty]).toBe(expectedValue); - }, - ); - - it(`${types.SUBMIT_CHANGES_SUCCESS} sets originalContent to content current value`, () => { - const editedContent = `${content} plus something else`; - - state = createState({ - originalContent: content, - content: editedContent, - }); - mutations[types.SUBMIT_CHANGES_SUCCESS](state); - - expect(state.originalContent).toBe(state.content); - }); -}); |