diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-14 21:09:08 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-14 21:09:08 +0000 |
commit | 866ca4e49ff74ffadf8e6f6ff663a168489c2aba (patch) | |
tree | cc3135b1bae11dbd1cb3a30cb547473ad89a5551 /spec/frontend/monitoring | |
parent | 26a50872e9da9509c52c70f74dc21698fec906db (diff) | |
download | gitlab-ce-866ca4e49ff74ffadf8e6f6ff663a168489c2aba.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/monitoring')
-rw-r--r-- | spec/frontend/monitoring/store/mutations_spec.js | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/spec/frontend/monitoring/store/mutations_spec.js b/spec/frontend/monitoring/store/mutations_spec.js index b0ac42e0e5f..d9aebafb9ec 100644 --- a/spec/frontend/monitoring/store/mutations_spec.js +++ b/spec/frontend/monitoring/store/mutations_spec.js @@ -91,16 +91,37 @@ describe('Monitoring mutations', () => { expect(stateCopy.projectPath).toEqual('/gitlab-org/gitlab-foss'); }); - it('should not remove default value of logsPath', () => { + it('should not remove previously set properties', () => { const defaultLogsPath = stateCopy.logsPath; mutations[types.SET_ENDPOINTS](stateCopy, { + logsPath: defaultLogsPath, + }); + mutations[types.SET_ENDPOINTS](stateCopy, { dashboardEndpoint: 'dashboard.json', }); + mutations[types.SET_ENDPOINTS](stateCopy, { + projectPath: '/gitlab-org/gitlab-foss', + }); - expect(stateCopy.logsPath).toBe(defaultLogsPath); + expect(stateCopy).toMatchObject({ + logsPath: defaultLogsPath, + dashboardEndpoint: 'dashboard.json', + projectPath: '/gitlab-org/gitlab-foss', + }); + }); + + it('should not update unknown properties', () => { + mutations[types.SET_ENDPOINTS](stateCopy, { + dashboardEndpoint: 'dashboard.json', + someOtherProperty: 'some invalid value', // someOtherProperty is not allowed + }); + + expect(stateCopy.dashboardEndpoint).toBe('dashboard.json'); + expect(stateCopy.someOtherProperty).toBeUndefined(); }); }); + describe('Individual panel/metric results', () => { const metricId = '12_system_metrics_kubernetes_container_memory_total'; const result = [ |