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:
Diffstat (limited to 'spec/frontend/mr_notes/stores/mutations_spec.js')
-rw-r--r--spec/frontend/mr_notes/stores/mutations_spec.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/frontend/mr_notes/stores/mutations_spec.js b/spec/frontend/mr_notes/stores/mutations_spec.js
new file mode 100644
index 00000000000..35b8a2e4be2
--- /dev/null
+++ b/spec/frontend/mr_notes/stores/mutations_spec.js
@@ -0,0 +1,27 @@
+import mutationTypes from '~/mr_notes/stores/mutation_types';
+import mutations from '~/mr_notes/stores/mutations';
+
+describe('MR Notes Mutations', () => {
+ describe(mutationTypes.SET_ENDPOINTS, () => {
+ it('should set the endpoints value', () => {
+ const state = {};
+ const endpoints = { endpointA: 'A', endpointB: 'B' };
+
+ mutations[mutationTypes.SET_ENDPOINTS](state, endpoints);
+
+ expect(state.endpoints).toEqual(endpoints);
+ });
+ });
+
+ describe(mutationTypes.SET_MR_METADATA, () => {
+ it('store the provided MR Metadata in the state', () => {
+ const state = {};
+ const metadata = { propA: 'A', propB: 'B' };
+
+ mutations[mutationTypes.SET_MR_METADATA](state, metadata);
+
+ expect(state.mrMetadata.propA).toBe('A');
+ expect(state.mrMetadata.propB).toBe('B');
+ });
+ });
+});