diff options
| author | Jose Ivan Vargas <jvargas@gitlab.com> | 2018-07-17 20:44:26 +0000 |
|---|---|---|
| committer | Clement Ho <clemmakesapps@gmail.com> | 2018-07-17 20:44:26 +0000 |
| commit | 236e752bfbb140b5cbe03f500b479eacdc7f98e0 (patch) | |
| tree | 5bf86aa5887278eaf93a855b5b7642c0a4cdb2e2 /spec/javascripts/monitoring | |
| parent | 2f16eab03d8af372ae8461de5abf91b480ffd761 (diff) | |
| download | gitlab-ce-236e752bfbb140b5cbe03f500b479eacdc7f98e0.tar.gz | |
Resolve "Metrics drop down doesn't show all environment, some not clickable"
Diffstat (limited to 'spec/javascripts/monitoring')
| -rw-r--r-- | spec/javascripts/monitoring/mock_data.js | 17 | ||||
| -rw-r--r-- | spec/javascripts/monitoring/monitoring_store_spec.js | 7 |
2 files changed, 23 insertions, 1 deletions
diff --git a/spec/javascripts/monitoring/mock_data.js b/spec/javascripts/monitoring/mock_data.js index 10808315372..e4c98a3bcb5 100644 --- a/spec/javascripts/monitoring/mock_data.js +++ b/spec/javascripts/monitoring/mock_data.js @@ -6561,6 +6561,9 @@ export const environmentData = [ folder_path: '/root/hello-prometheus/environments/folders/production', created_at: '2018-06-29T16:53:38.301Z', updated_at: '2018-06-29T16:57:09.825Z', + last_deployment: { + id: 127, + }, }, }, { @@ -6580,6 +6583,20 @@ export const environmentData = [ folder_path: '/root/hello-prometheus/environments/folders/review', created_at: '2018-07-03T18:39:41.702Z', updated_at: '2018-07-03T18:44:54.010Z', + last_deployment: { + id: 128, + }, + }, + }, + { + name: 'no-deployment', + size: 1, + latest: { + id: 36, + name: 'no-deployment/noop-branch', + state: 'available', + created_at: '2018-07-04T18:39:41.702Z', + updated_at: '2018-07-04T18:44:54.010Z', }, }, ]; diff --git a/spec/javascripts/monitoring/monitoring_store_spec.js b/spec/javascripts/monitoring/monitoring_store_spec.js index 08d54946787..ccdf4eda563 100644 --- a/spec/javascripts/monitoring/monitoring_store_spec.js +++ b/spec/javascripts/monitoring/monitoring_store_spec.js @@ -1,5 +1,5 @@ import MonitoringStore from '~/monitoring/stores/monitoring_store'; -import MonitoringMock, { deploymentData } from './mock_data'; +import MonitoringMock, { deploymentData, environmentData } from './mock_data'; describe('MonitoringStore', function () { this.store = new MonitoringStore(); @@ -21,4 +21,9 @@ describe('MonitoringStore', function () { expect(this.store.deploymentData.length).toEqual(3); expect(typeof this.store.deploymentData[0]).toEqual('object'); }); + + it('only stores environment data that contains deployments', () => { + this.store.storeEnvironmentsData(environmentData); + expect(this.store.environmentsData.length).toEqual(2); + }); }); |
