Commit 1f7e0672 authored by Mike Greiling's avatar Mike Greiling

Update test to ensure the correct applications are shown

parent 4ead30ab
import Vue from 'vue'; import Vue from 'vue';
import applications from '~/clusters/components/applications.vue'; import applications from '~/clusters/components/applications.vue';
import { CLUSTER_TYPE } from '~/clusters/constants';
import mountComponent from 'spec/helpers/vue_mount_component_helper'; import mountComponent from 'spec/helpers/vue_mount_component_helper';
describe('Applications', () => { describe('Applications', () => {
...@@ -14,9 +15,10 @@ describe('Applications', () => { ...@@ -14,9 +15,10 @@ describe('Applications', () => {
vm.$destroy(); vm.$destroy();
}); });
describe('', () => { describe('Project cluster applications', () => {
beforeEach(() => { beforeEach(() => {
vm = mountComponent(Applications, { vm = mountComponent(Applications, {
type: CLUSTER_TYPE.PROJECT,
applications: { applications: {
helm: { title: 'Helm Tiller' }, helm: { title: 'Helm Tiller' },
ingress: { title: 'Ingress' }, ingress: { title: 'Ingress' },
...@@ -30,31 +32,76 @@ describe('Applications', () => { ...@@ -30,31 +32,76 @@ describe('Applications', () => {
}); });
it('renders a row for Helm Tiller', () => { it('renders a row for Helm Tiller', () => {
expect(vm.$el.querySelector('.js-cluster-application-row-helm')).toBeDefined(); expect(vm.$el.querySelector('.js-cluster-application-row-helm')).not.toBeNull();
}); });
it('renders a row for Ingress', () => { it('renders a row for Ingress', () => {
expect(vm.$el.querySelector('.js-cluster-application-row-ingress')).toBeDefined(); expect(vm.$el.querySelector('.js-cluster-application-row-ingress')).not.toBeNull();
}); });
it('renders a row for Cert-Manager', () => { it('renders a row for Cert-Manager', () => {
expect(vm.$el.querySelector('.js-cluster-application-row-cert_manager')).toBeDefined(); expect(vm.$el.querySelector('.js-cluster-application-row-cert_manager')).not.toBeNull();
}); });
it('renders a row for Prometheus', () => { it('renders a row for Prometheus', () => {
expect(vm.$el.querySelector('.js-cluster-application-row-prometheus')).toBeDefined(); expect(vm.$el.querySelector('.js-cluster-application-row-prometheus')).not.toBeNull();
}); });
it('renders a row for GitLab Runner', () => { it('renders a row for GitLab Runner', () => {
expect(vm.$el.querySelector('.js-cluster-application-row-runner')).toBeDefined(); expect(vm.$el.querySelector('.js-cluster-application-row-runner')).not.toBeNull();
}); });
it('renders a row for Jupyter', () => { it('renders a row for Jupyter', () => {
expect(vm.$el.querySelector('.js-cluster-application-row-jupyter')).not.toBe(null); expect(vm.$el.querySelector('.js-cluster-application-row-jupyter')).not.toBeNull();
}); });
it('renders a row for Knative', () => { it('renders a row for Knative', () => {
expect(vm.$el.querySelector('.js-cluster-application-row-knative')).not.toBe(null); expect(vm.$el.querySelector('.js-cluster-application-row-knative')).not.toBeNull();
});
});
describe('Group cluster applications', () => {
beforeEach(() => {
vm = mountComponent(Applications, {
type: CLUSTER_TYPE.GROUP,
applications: {
helm: { title: 'Helm Tiller' },
ingress: { title: 'Ingress' },
cert_manager: { title: 'Cert-Manager' },
runner: { title: 'GitLab Runner' },
prometheus: { title: 'Prometheus' },
jupyter: { title: 'JupyterHub' },
knative: { title: 'Knative' },
},
});
});
it('renders a row for Helm Tiller', () => {
expect(vm.$el.querySelector('.js-cluster-application-row-helm')).not.toBeNull();
});
it('renders a row for Ingress', () => {
expect(vm.$el.querySelector('.js-cluster-application-row-ingress')).not.toBeNull();
});
it('renders a row for Cert-Manager', () => {
expect(vm.$el.querySelector('.js-cluster-application-row-cert_manager')).not.toBeNull();
});
it('renders a row for Prometheus', () => {
expect(vm.$el.querySelector('.js-cluster-application-row-prometheus')).toBeNull();
});
it('renders a row for GitLab Runner', () => {
expect(vm.$el.querySelector('.js-cluster-application-row-runner')).toBeNull();
});
it('renders a row for Jupyter', () => {
expect(vm.$el.querySelector('.js-cluster-application-row-jupyter')).toBeNull();
});
it('renders a row for Knative', () => {
expect(vm.$el.querySelector('.js-cluster-application-row-knative')).toBeNull();
}); });
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment