summaryrefslogtreecommitdiff
path: root/spec/javascripts/clusters/components/applications_spec.js
diff options
context:
space:
mode:
authorClement Ho <clemmakesapps@gmail.com>2018-03-01 18:14:53 +0000
committerClement Ho <clemmakesapps@gmail.com>2018-03-01 18:14:53 +0000
commit119cdf3b3b56aa3c237b070ffde856f09992a8a1 (patch)
tree02e6cd5efb2a7f2f2247da0ca811ef70c54f40a9 /spec/javascripts/clusters/components/applications_spec.js
parent56e106d47f76c8692bfc2acdd018f5b2d11afd95 (diff)
parentbb41a889487463f626796a390148ae7870c16824 (diff)
downloadgitlab-ce-webpack-registry.tar.gz
Merge branch 'master' into 'webpack-registry'webpack-registry
# Conflicts: # config/webpack.config.js
Diffstat (limited to 'spec/javascripts/clusters/components/applications_spec.js')
-rw-r--r--spec/javascripts/clusters/components/applications_spec.js67
1 files changed, 67 insertions, 0 deletions
diff --git a/spec/javascripts/clusters/components/applications_spec.js b/spec/javascripts/clusters/components/applications_spec.js
index 15832c38f25..dfb4cc1b9b1 100644
--- a/spec/javascripts/clusters/components/applications_spec.js
+++ b/spec/javascripts/clusters/components/applications_spec.js
@@ -44,4 +44,71 @@ describe('Applications', () => {
});
/* */
});
+
+ describe('Ingress application', () => {
+ describe('when installed', () => {
+ describe('with ip address', () => {
+ it('renders ip address with a clipboard button', () => {
+ vm = mountComponent(Applications, {
+ applications: {
+ ingress: {
+ title: 'Ingress',
+ status: 'installed',
+ externalIp: '0.0.0.0',
+ },
+ helm: { title: 'Helm Tiller' },
+ runner: { title: 'GitLab Runner' },
+ prometheus: { title: 'Prometheus' },
+ },
+ });
+
+ expect(
+ vm.$el.querySelector('.js-ip-address').value,
+ ).toEqual('0.0.0.0');
+
+ expect(
+ vm.$el.querySelector('.js-clipboard-btn').getAttribute('data-clipboard-text'),
+ ).toEqual('0.0.0.0');
+ });
+ });
+
+ describe('without ip address', () => {
+ it('renders an input text with a question mark and an alert text', () => {
+ vm = mountComponent(Applications, {
+ applications: {
+ ingress: {
+ title: 'Ingress',
+ status: 'installed',
+ },
+ helm: { title: 'Helm Tiller' },
+ runner: { title: 'GitLab Runner' },
+ prometheus: { title: 'Prometheus' },
+ },
+ });
+
+ expect(
+ vm.$el.querySelector('.js-ip-address').value,
+ ).toEqual('?');
+
+ expect(vm.$el.querySelector('.js-no-ip-message')).not.toBe(null);
+ });
+ });
+ });
+
+ describe('before installing', () => {
+ it('does not render the IP address', () => {
+ vm = mountComponent(Applications, {
+ applications: {
+ helm: { title: 'Helm Tiller' },
+ ingress: { title: 'Ingress' },
+ runner: { title: 'GitLab Runner' },
+ prometheus: { title: 'Prometheus' },
+ },
+ });
+
+ expect(vm.$el.textContent).not.toContain('Ingress IP Address');
+ expect(vm.$el.querySelector('.js-ip-address')).toBe(null);
+ });
+ });
+ });
});