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/diffs/store/mutations_spec.js')
-rw-r--r--spec/frontend/diffs/store/mutations_spec.js14
1 files changed, 8 insertions, 6 deletions
diff --git a/spec/frontend/diffs/store/mutations_spec.js b/spec/frontend/diffs/store/mutations_spec.js
index a8ae759e693..b549ca42634 100644
--- a/spec/frontend/diffs/store/mutations_spec.js
+++ b/spec/frontend/diffs/store/mutations_spec.js
@@ -7,15 +7,17 @@ import diffFileMockData from '../mock_data/diff_file';
describe('DiffsStoreMutations', () => {
describe('SET_BASE_CONFIG', () => {
- it('should set endpoint and project path', () => {
+ it.each`
+ prop | value
+ ${'endpoint'} | ${'/diffs/endpoint'}
+ ${'projectPath'} | ${'/root/project'}
+ ${'endpointUpdateUser'} | ${'/user/preferences'}
+ `('should set the $prop property into state', ({ prop, value }) => {
const state = {};
- const endpoint = '/diffs/endpoint';
- const projectPath = '/root/project';
- mutations[types.SET_BASE_CONFIG](state, { endpoint, projectPath });
+ mutations[types.SET_BASE_CONFIG](state, { [prop]: value });
- expect(state.endpoint).toEqual(endpoint);
- expect(state.projectPath).toEqual(projectPath);
+ expect(state[prop]).toEqual(value);
});
});