From 427c549b6396885fb60a687326b6cd62878e4ca3 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 14 Jan 2020 00:08:14 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- .../clusters/components/applications_spec.js | 66 ++++------------------ spec/frontend/clusters/services/mock_data.js | 2 +- .../clusters/stores/clusters_store_spec.js | 12 ---- 3 files changed, 11 insertions(+), 69 deletions(-) (limited to 'spec/frontend/clusters') diff --git a/spec/frontend/clusters/components/applications_spec.js b/spec/frontend/clusters/components/applications_spec.js index e8c5a2bd242..a646ea8c700 100644 --- a/spec/frontend/clusters/components/applications_spec.js +++ b/spec/frontend/clusters/components/applications_spec.js @@ -199,7 +199,7 @@ describe('Applications', () => { prometheus: { title: 'Prometheus' }, jupyter: { title: 'JupyterHub', hostname: '' }, knative: { title: 'Knative', hostname: '' }, - elastic_stack: { title: 'Elastic Stack', kibana_hostname: '' }, + elastic_stack: { title: 'Elastic Stack' }, }, }); @@ -433,79 +433,33 @@ describe('Applications', () => { }); describe('Elastic Stack application', () => { - describe('with ingress installed with ip & elastic stack installable', () => { + describe('with elastic stack installable', () => { it('renders hostname active input', () => { vm = mountComponent(Applications, { applications: { ...APPLICATIONS_MOCK_STATE, - ingress: { - title: 'Ingress', - status: 'installed', - externalIp: '1.1.1.1', - }, }, }); expect( vm.$el - .querySelector('.js-cluster-application-row-elastic_stack .js-hostname') - .getAttribute('readonly'), - ).toEqual(null); - }); - }); - - describe('with ingress installed without external ip', () => { - it('does not render hostname input', () => { - vm = mountComponent(Applications, { - applications: { - ...APPLICATIONS_MOCK_STATE, - ingress: { title: 'Ingress', status: 'installed' }, - }, - }); - - expect(vm.$el.querySelector('.js-cluster-application-row-elastic_stack .js-hostname')).toBe( - null, - ); + .querySelector( + '.js-cluster-application-row-elastic_stack .js-cluster-application-install-button', + ) + .getAttribute('disabled'), + ).toEqual('disabled'); }); }); - describe('with ingress & elastic stack installed', () => { - it('renders readonly input', () => { + describe('elastic stack installed', () => { + it('renders uninstall button', () => { vm = mountComponent(Applications, { applications: { ...APPLICATIONS_MOCK_STATE, - ingress: { - title: 'Ingress', - status: 'installed', - externalIp: '1.1.1.1', - modsecurity_enabled: false, - }, - elastic_stack: { title: 'Elastic Stack', status: 'installed', kibana_hostname: '' }, + elastic_stack: { title: 'Elastic Stack', status: 'installed' }, }, }); - expect( - vm.$el - .querySelector('.js-cluster-application-row-elastic_stack .js-hostname') - .getAttribute('readonly'), - ).toEqual('readonly'); - }); - }); - - describe('without ingress installed', () => { - beforeEach(() => { - vm = mountComponent(Applications, { - applications: APPLICATIONS_MOCK_STATE, - }); - }); - - it('does not render input', () => { - expect(vm.$el.querySelector('.js-cluster-application-row-elastic_stack .js-hostname')).toBe( - null, - ); - }); - - it('renders disabled install button', () => { expect( vm.$el .querySelector( diff --git a/spec/frontend/clusters/services/mock_data.js b/spec/frontend/clusters/services/mock_data.js index 98fa0ec3b07..f0bcf5d980f 100644 --- a/spec/frontend/clusters/services/mock_data.js +++ b/spec/frontend/clusters/services/mock_data.js @@ -157,7 +157,7 @@ const APPLICATIONS_MOCK_STATE = { prometheus: { title: 'Prometheus' }, jupyter: { title: 'JupyterHub', status: 'installable', hostname: '' }, knative: { title: 'Knative ', status: 'installable', hostname: '' }, - elastic_stack: { title: 'Elastic Stack', status: 'installable', kibana_hostname: '' }, + elastic_stack: { title: 'Elastic Stack', status: 'installable' }, }; export { CLUSTERS_MOCK_DATA, DEFAULT_APPLICATION_STATE, APPLICATIONS_MOCK_STATE }; diff --git a/spec/frontend/clusters/stores/clusters_store_spec.js b/spec/frontend/clusters/stores/clusters_store_spec.js index c7ec4ddc464..f2dbdd0638b 100644 --- a/spec/frontend/clusters/stores/clusters_store_spec.js +++ b/spec/frontend/clusters/stores/clusters_store_spec.js @@ -167,7 +167,6 @@ describe('Clusters Store', () => { installFailed: true, statusReason: mockResponseData.applications[7].status_reason, requestReason: null, - kibana_hostname: '', installed: false, uninstallable: false, uninstallSuccessful: false, @@ -216,16 +215,5 @@ describe('Clusters Store', () => { `jupyter.${store.state.applications.ingress.externalIp}.nip.io`, ); }); - - it('sets default hostname for elastic stack when ingress has a ip address', () => { - const mockResponseData = - CLUSTERS_MOCK_DATA.GET['/gitlab-org/gitlab-shell/clusters/2/status.json'].data; - - store.updateStateFromServer(mockResponseData); - - expect(store.state.applications.elastic_stack.kibana_hostname).toEqual( - `kibana.${store.state.applications.ingress.externalIp}.nip.io`, - ); - }); }); }); -- cgit v1.2.3