summaryrefslogtreecommitdiff
path: root/spec/javascripts/clusters/components/applications_spec.js
diff options
context:
space:
mode:
authorwalkafwalka <2865898-walkafwalka@users.noreply.gitlab.com>2019-03-07 13:51:43 -0800
committerwalkafwalka <2865898-walkafwalka@users.noreply.gitlab.com>2019-03-07 15:25:48 -0800
commit460797dec3dc143943390e86a09d6e6b45a465d8 (patch)
treea5495703f3bfd1152929c84853322cd9a6812f15 /spec/javascripts/clusters/components/applications_spec.js
parent31cf53df4d766ef58d6d5be60d5fa2e380406fc8 (diff)
downloadgitlab-ce-ingress-hostnames.tar.gz
Add support for ingress hostnamesingress-hostnames
Diffstat (limited to 'spec/javascripts/clusters/components/applications_spec.js')
-rw-r--r--spec/javascripts/clusters/components/applications_spec.js42
1 files changed, 34 insertions, 8 deletions
diff --git a/spec/javascripts/clusters/components/applications_spec.js b/spec/javascripts/clusters/components/applications_spec.js
index 8daf0282184..e2466bf326c 100644
--- a/spec/javascripts/clusters/components/applications_spec.js
+++ b/spec/javascripts/clusters/components/applications_spec.js
@@ -106,7 +106,7 @@ describe('Applications', () => {
},
});
- expect(vm.$el.querySelector('.js-ip-address').value).toEqual('0.0.0.0');
+ expect(vm.$el.querySelector('.js-endpoint').value).toEqual('0.0.0.0');
expect(
vm.$el.querySelector('.js-clipboard-btn').getAttribute('data-clipboard-text'),
@@ -114,6 +114,32 @@ describe('Applications', () => {
});
});
+ describe('with hostname', () => {
+ it('renders hostname with a clipboard button', () => {
+ vm = mountComponent(Applications, {
+ applications: {
+ ingress: {
+ title: 'Ingress',
+ status: 'installed',
+ externalHostname: 'localhost.localdomain',
+ },
+ helm: { title: 'Helm Tiller' },
+ cert_manager: { title: 'Cert-Manager' },
+ runner: { title: 'GitLab Runner' },
+ prometheus: { title: 'Prometheus' },
+ jupyter: { title: 'JupyterHub', hostname: '' },
+ knative: { title: 'Knative', hostname: '' },
+ },
+ });
+
+ expect(vm.$el.querySelector('.js-endpoint').value).toEqual('localhost.localdomain');
+
+ expect(
+ vm.$el.querySelector('.js-clipboard-btn').getAttribute('data-clipboard-text'),
+ ).toEqual('localhost.localdomain');
+ });
+ });
+
describe('without ip address', () => {
it('renders an input text with a question mark and an alert text', () => {
vm = mountComponent(Applications, {
@@ -126,9 +152,9 @@ describe('Applications', () => {
},
});
- expect(vm.$el.querySelector('.js-ip-address').value).toEqual('?');
+ expect(vm.$el.querySelector('.js-endpoint').value).toEqual('?');
- expect(vm.$el.querySelector('.js-no-ip-message')).not.toBe(null);
+ expect(vm.$el.querySelector('.js-no-endpoint-message')).not.toBe(null);
});
});
});
@@ -140,7 +166,7 @@ describe('Applications', () => {
});
expect(vm.$el.textContent).not.toContain('Ingress IP Address');
- expect(vm.$el.querySelector('.js-ip-address')).toBe(null);
+ expect(vm.$el.querySelector('.js-endpoint')).toBe(null);
});
});
@@ -268,11 +294,11 @@ describe('Applications', () => {
it('renders ip address with a clipboard button', () => {
vm = mountComponent(Applications, props);
- expect(vm.$el.querySelector('.js-knative-ip-address').value).toEqual('1.1.1.1');
+ expect(vm.$el.querySelector('.js-knative-endpoint').value).toEqual('1.1.1.1');
expect(
vm.$el
- .querySelector('.js-knative-ip-clipboard-btn')
+ .querySelector('.js-knative-endpoint-clipboard-btn')
.getAttribute('data-clipboard-text'),
).toEqual('1.1.1.1');
});
@@ -316,9 +342,9 @@ describe('Applications', () => {
},
});
- expect(vm.$el.querySelector('.js-knative-ip-address').value).toEqual('?');
+ expect(vm.$el.querySelector('.js-knative-endpoint').value).toEqual('?');
- expect(vm.$el.querySelector('.js-no-knative-ip-message')).not.toBe(null);
+ expect(vm.$el.querySelector('.js-no-knative-endpoint-message')).not.toBe(null);
});
});
});