debian-mirror-gitlab/spec/frontend/clusters/components/applications_spec.js

552 lines
17 KiB
JavaScript
Raw Normal View History

2020-06-23 00:09:42 +05:30
import { shallowMount, mount } from '@vue/test-utils';
import ApplicationRow from '~/clusters/components/application_row.vue';
2021-03-11 19:13:27 +05:30
import Applications from '~/clusters/components/applications.vue';
2019-12-26 22:10:19 +05:30
import CrossplaneProviderStack from '~/clusters/components/crossplane_provider_stack.vue';
2020-05-24 23:13:21 +05:30
import FluentdOutputSettings from '~/clusters/components/fluentd_output_settings.vue';
2021-03-11 19:13:27 +05:30
import IngressModsecuritySettings from '~/clusters/components/ingress_modsecurity_settings.vue';
import KnativeDomainEditor from '~/clusters/components/knative_domain_editor.vue';
import { CLUSTER_TYPE, PROVIDER_TYPE } from '~/clusters/constants';
import eventHub from '~/clusters/event_hub';
import { APPLICATIONS_MOCK_STATE } from '../services/mock_data';
2018-03-17 18:26:18 +05:30
describe('Applications', () => {
2020-06-23 00:09:42 +05:30
let wrapper;
2018-03-17 18:26:18 +05:30
beforeEach(() => {
2020-04-22 19:07:51 +05:30
gon.features = gon.features || {};
2018-03-17 18:26:18 +05:30
});
2021-03-11 19:13:27 +05:30
const createComponent = ({ applications, type, propsData } = {}, isShallow) => {
2020-06-23 00:09:42 +05:30
const mountMethod = isShallow ? shallowMount : mount;
wrapper = mountMethod(Applications, {
stubs: { ApplicationRow },
propsData: {
type,
applications: { ...APPLICATIONS_MOCK_STATE, ...applications },
2021-03-08 18:12:59 +05:30
...propsData,
2020-06-23 00:09:42 +05:30
},
});
};
2021-03-11 19:13:27 +05:30
const createShallowComponent = (options) => createComponent(options, true);
2021-03-08 18:12:59 +05:30
const findByTestId = (id) => wrapper.find(`[data-testid="${id}"]`);
2018-03-17 18:26:18 +05:30
afterEach(() => {
2020-06-23 00:09:42 +05:30
wrapper.destroy();
2018-03-17 18:26:18 +05:30
});
2019-02-15 15:39:39 +05:30
describe('Project cluster applications', () => {
2018-03-17 18:26:18 +05:30
beforeEach(() => {
2021-03-11 19:13:27 +05:30
createComponent({ type: CLUSTER_TYPE.PROJECT });
2018-03-17 18:26:18 +05:30
});
it('renders a row for Ingress', () => {
2020-06-23 00:09:42 +05:30
expect(wrapper.find('.js-cluster-application-row-ingress').exists()).toBe(true);
2019-02-15 15:39:39 +05:30
});
it('renders a row for Cert-Manager', () => {
2020-06-23 00:09:42 +05:30
expect(wrapper.find('.js-cluster-application-row-cert_manager').exists()).toBe(true);
2019-02-15 15:39:39 +05:30
});
2019-12-26 22:10:19 +05:30
it('renders a row for Crossplane', () => {
2020-06-23 00:09:42 +05:30
expect(wrapper.find('.js-cluster-application-row-crossplane').exists()).toBe(true);
2019-12-26 22:10:19 +05:30
});
2019-02-15 15:39:39 +05:30
it('renders a row for Prometheus', () => {
2020-06-23 00:09:42 +05:30
expect(wrapper.find('.js-cluster-application-row-prometheus').exists()).toBe(true);
2019-02-15 15:39:39 +05:30
});
it('renders a row for GitLab Runner', () => {
2020-06-23 00:09:42 +05:30
expect(wrapper.find('.js-cluster-application-row-runner').exists()).toBe(true);
2019-02-15 15:39:39 +05:30
});
it('renders a row for Jupyter', () => {
2020-06-23 00:09:42 +05:30
expect(wrapper.find('.js-cluster-application-row-jupyter').exists()).toBe(true);
2019-02-15 15:39:39 +05:30
});
it('renders a row for Knative', () => {
2020-06-23 00:09:42 +05:30
expect(wrapper.find('.js-cluster-application-row-knative').exists()).toBe(true);
2019-02-15 15:39:39 +05:30
});
2019-12-26 22:10:19 +05:30
it('renders a row for Elastic Stack', () => {
2020-06-23 00:09:42 +05:30
expect(wrapper.find('.js-cluster-application-row-elastic_stack').exists()).toBe(true);
2019-12-26 22:10:19 +05:30
});
2020-05-24 23:13:21 +05:30
it('renders a row for Fluentd', () => {
2020-06-23 00:09:42 +05:30
expect(wrapper.find('.js-cluster-application-row-fluentd').exists()).toBe(true);
2020-05-24 23:13:21 +05:30
});
2020-10-24 23:57:45 +05:30
it('renders a row for Cilium', () => {
expect(wrapper.find('.js-cluster-application-row-cilium').exists()).toBe(true);
});
2019-02-15 15:39:39 +05:30
});
describe('Group cluster applications', () => {
beforeEach(() => {
2021-03-11 19:13:27 +05:30
createComponent({ type: CLUSTER_TYPE.GROUP });
2019-02-15 15:39:39 +05:30
});
it('renders a row for Ingress', () => {
2020-06-23 00:09:42 +05:30
expect(wrapper.find('.js-cluster-application-row-ingress').exists()).toBe(true);
2019-02-15 15:39:39 +05:30
});
it('renders a row for Cert-Manager', () => {
2020-06-23 00:09:42 +05:30
expect(wrapper.find('.js-cluster-application-row-cert_manager').exists()).toBe(true);
2018-03-17 18:26:18 +05:30
});
2019-12-26 22:10:19 +05:30
it('renders a row for Crossplane', () => {
2020-06-23 00:09:42 +05:30
expect(wrapper.find('.js-cluster-application-row-crossplane').exists()).toBe(true);
2019-12-26 22:10:19 +05:30
});
2018-03-17 18:26:18 +05:30
it('renders a row for Prometheus', () => {
2020-06-23 00:09:42 +05:30
expect(wrapper.find('.js-cluster-application-row-prometheus').exists()).toBe(true);
2018-03-17 18:26:18 +05:30
});
it('renders a row for GitLab Runner', () => {
2020-06-23 00:09:42 +05:30
expect(wrapper.find('.js-cluster-application-row-runner').exists()).toBe(true);
2018-03-17 18:26:18 +05:30
});
2018-11-08 19:23:39 +05:30
it('renders a row for Jupyter', () => {
2020-06-23 00:09:42 +05:30
expect(wrapper.find('.js-cluster-application-row-jupyter').exists()).toBe(true);
2018-11-08 19:23:39 +05:30
});
2018-12-13 13:39:08 +05:30
it('renders a row for Knative', () => {
2020-06-23 00:09:42 +05:30
expect(wrapper.find('.js-cluster-application-row-knative').exists()).toBe(true);
2019-12-04 20:38:33 +05:30
});
2019-12-26 22:10:19 +05:30
it('renders a row for Elastic Stack', () => {
2020-06-23 00:09:42 +05:30
expect(wrapper.find('.js-cluster-application-row-elastic_stack').exists()).toBe(true);
2019-12-26 22:10:19 +05:30
});
2020-05-24 23:13:21 +05:30
it('renders a row for Fluentd', () => {
2020-06-23 00:09:42 +05:30
expect(wrapper.find('.js-cluster-application-row-fluentd').exists()).toBe(true);
2020-05-24 23:13:21 +05:30
});
2020-10-24 23:57:45 +05:30
it('renders a row for Cilium', () => {
expect(wrapper.find('.js-cluster-application-row-cilium').exists()).toBe(true);
});
2019-12-04 20:38:33 +05:30
});
describe('Instance cluster applications', () => {
beforeEach(() => {
2021-03-11 19:13:27 +05:30
createComponent({ type: CLUSTER_TYPE.INSTANCE });
2019-12-04 20:38:33 +05:30
});
it('renders a row for Ingress', () => {
2020-06-23 00:09:42 +05:30
expect(wrapper.find('.js-cluster-application-row-ingress').exists()).toBe(true);
2019-12-04 20:38:33 +05:30
});
it('renders a row for Cert-Manager', () => {
2020-06-23 00:09:42 +05:30
expect(wrapper.find('.js-cluster-application-row-cert_manager').exists()).toBe(true);
2019-12-04 20:38:33 +05:30
});
2019-12-26 22:10:19 +05:30
it('renders a row for Crossplane', () => {
2020-06-23 00:09:42 +05:30
expect(wrapper.find('.js-cluster-application-row-crossplane').exists()).toBe(true);
2019-12-26 22:10:19 +05:30
});
2019-12-04 20:38:33 +05:30
it('renders a row for Prometheus', () => {
2020-06-23 00:09:42 +05:30
expect(wrapper.find('.js-cluster-application-row-prometheus').exists()).toBe(true);
2019-12-04 20:38:33 +05:30
});
it('renders a row for GitLab Runner', () => {
2020-06-23 00:09:42 +05:30
expect(wrapper.find('.js-cluster-application-row-runner').exists()).toBe(true);
2019-12-04 20:38:33 +05:30
});
it('renders a row for Jupyter', () => {
2020-06-23 00:09:42 +05:30
expect(wrapper.find('.js-cluster-application-row-jupyter').exists()).toBe(true);
2019-12-04 20:38:33 +05:30
});
it('renders a row for Knative', () => {
2020-06-23 00:09:42 +05:30
expect(wrapper.find('.js-cluster-application-row-knative').exists()).toBe(true);
2018-12-13 13:39:08 +05:30
});
2019-12-26 22:10:19 +05:30
it('renders a row for Elastic Stack', () => {
2020-06-23 00:09:42 +05:30
expect(wrapper.find('.js-cluster-application-row-elastic_stack').exists()).toBe(true);
2019-12-26 22:10:19 +05:30
});
2020-05-24 23:13:21 +05:30
it('renders a row for Fluentd', () => {
2020-06-23 00:09:42 +05:30
expect(wrapper.find('.js-cluster-application-row-fluentd').exists()).toBe(true);
2020-05-24 23:13:21 +05:30
});
2020-10-24 23:57:45 +05:30
it('renders a row for Cilium', () => {
expect(wrapper.find('.js-cluster-application-row-cilium').exists()).toBe(true);
});
2018-03-27 19:54:05 +05:30
});
2020-04-22 19:07:51 +05:30
describe('Helm application', () => {
2020-10-24 23:57:45 +05:30
it('does not render a row for Helm Tiller', () => {
2021-03-11 19:13:27 +05:30
createComponent();
2020-10-24 23:57:45 +05:30
expect(wrapper.find('.js-cluster-application-row-helm').exists()).toBe(false);
2020-04-22 19:07:51 +05:30
});
});
2018-03-27 19:54:05 +05:30
describe('Ingress application', () => {
2020-06-23 00:09:42 +05:30
it('shows the correct warning message', () => {
2021-03-11 19:13:27 +05:30
createComponent();
2020-06-23 00:09:42 +05:30
expect(findByTestId('ingressCostWarning').element).toMatchSnapshot();
});
2020-04-08 14:13:33 +05:30
describe('with nested component', () => {
const propsData = {
applications: {
ingress: {
title: 'Ingress',
status: 'installed',
},
},
};
2021-03-11 19:13:27 +05:30
beforeEach(() => createShallowComponent(propsData));
2020-06-23 00:09:42 +05:30
2020-04-08 14:13:33 +05:30
it('renders IngressModsecuritySettings', () => {
const modsecuritySettings = wrapper.find(IngressModsecuritySettings);
expect(modsecuritySettings.exists()).toBe(true);
});
});
2018-03-27 19:54:05 +05:30
describe('when installed', () => {
describe('with ip address', () => {
it('renders ip address with a clipboard button', () => {
2021-03-11 19:13:27 +05:30
createComponent({
2018-03-27 19:54:05 +05:30
applications: {
ingress: {
title: 'Ingress',
status: 'installed',
externalIp: '0.0.0.0',
},
},
});
2020-06-23 00:09:42 +05:30
expect(wrapper.find('.js-endpoint').element.value).toEqual('0.0.0.0');
expect(wrapper.find('.js-clipboard-btn').attributes('data-clipboard-text')).toEqual(
'0.0.0.0',
);
2018-03-27 19:54:05 +05:30
});
});
2019-07-07 11:18:12 +05:30
describe('with hostname', () => {
it('renders hostname with a clipboard button', () => {
2021-03-11 19:13:27 +05:30
createComponent({
2018-03-27 19:54:05 +05:30
applications: {
ingress: {
title: 'Ingress',
status: 'installed',
2019-07-07 11:18:12 +05:30
externalHostname: 'localhost.localdomain',
2020-03-13 15:44:24 +05:30
modsecurity_enabled: false,
2018-03-27 19:54:05 +05:30
},
2019-02-15 15:39:39 +05:30
cert_manager: { title: 'Cert-Manager' },
2019-12-26 22:10:19 +05:30
crossplane: { title: 'Crossplane', stack: '' },
2018-03-27 19:54:05 +05:30
runner: { title: 'GitLab Runner' },
prometheus: { title: 'Prometheus' },
2018-11-08 19:23:39 +05:30
jupyter: { title: 'JupyterHub', hostname: '' },
2018-12-13 13:39:08 +05:30
knative: { title: 'Knative', hostname: '' },
2020-03-13 15:44:24 +05:30
elastic_stack: { title: 'Elastic Stack' },
2020-05-24 23:13:21 +05:30
fluentd: { title: 'Fluentd' },
2020-10-24 23:57:45 +05:30
cilium: { title: 'GitLab Container Network Policies' },
2018-03-27 19:54:05 +05:30
},
});
2020-06-23 00:09:42 +05:30
expect(wrapper.find('.js-endpoint').element.value).toEqual('localhost.localdomain');
2019-07-07 11:18:12 +05:30
2020-06-23 00:09:42 +05:30
expect(wrapper.find('.js-clipboard-btn').attributes('data-clipboard-text')).toEqual(
'localhost.localdomain',
);
2019-07-07 11:18:12 +05:30
});
});
describe('without ip address', () => {
it('renders an input text with a loading icon and an alert text', () => {
2021-03-11 19:13:27 +05:30
createComponent({
2019-07-07 11:18:12 +05:30
applications: {
ingress: {
title: 'Ingress',
status: 'installed',
},
},
});
2018-03-27 19:54:05 +05:30
2020-06-23 00:09:42 +05:30
expect(wrapper.find('.js-ingress-ip-loading-icon').exists()).toBe(true);
expect(wrapper.find('.js-no-endpoint-message').exists()).toBe(true);
2018-03-27 19:54:05 +05:30
});
});
});
describe('before installing', () => {
it('does not render the IP address', () => {
2021-03-11 19:13:27 +05:30
createComponent();
2018-03-27 19:54:05 +05:30
2020-06-23 00:09:42 +05:30
expect(wrapper.text()).not.toContain('Ingress IP Address');
expect(wrapper.find('.js-endpoint').exists()).toBe(false);
2018-03-27 19:54:05 +05:30
});
});
2020-06-23 00:09:42 +05:30
});
2018-11-08 19:23:39 +05:30
2020-06-23 00:09:42 +05:30
describe('Cert-Manager application', () => {
it('shows the correct description', () => {
2021-03-11 19:13:27 +05:30
createComponent();
2020-06-23 00:09:42 +05:30
expect(findByTestId('certManagerDescription').element).toMatchSnapshot();
});
2019-02-15 15:39:39 +05:30
2020-06-23 00:09:42 +05:30
describe('when not installed', () => {
it('renders email & allows editing', () => {
2021-03-11 19:13:27 +05:30
createComponent({
2020-06-23 00:09:42 +05:30
applications: {
cert_manager: {
title: 'Cert-Manager',
email: 'before@example.com',
status: 'installable',
},
},
2019-02-15 15:39:39 +05:30
});
2020-06-23 00:09:42 +05:30
expect(wrapper.find('.js-email').element.value).toEqual('before@example.com');
expect(wrapper.find('.js-email').attributes('readonly')).toBe(undefined);
2019-02-15 15:39:39 +05:30
});
2020-06-23 00:09:42 +05:30
});
2019-02-15 15:39:39 +05:30
2020-06-23 00:09:42 +05:30
describe('when installed', () => {
it('renders email in readonly', () => {
2021-03-11 19:13:27 +05:30
createComponent({
2020-06-23 00:09:42 +05:30
applications: {
cert_manager: {
title: 'Cert-Manager',
email: 'after@example.com',
status: 'installed',
2019-02-15 15:39:39 +05:30
},
2020-06-23 00:09:42 +05:30
},
2019-02-15 15:39:39 +05:30
});
2020-06-23 00:09:42 +05:30
expect(wrapper.find('.js-email').element.value).toEqual('after@example.com');
expect(wrapper.find('.js-email').attributes('readonly')).toEqual('readonly');
2019-02-15 15:39:39 +05:30
});
});
2020-06-23 00:09:42 +05:30
});
2019-02-15 15:39:39 +05:30
2020-06-23 00:09:42 +05:30
describe('Jupyter application', () => {
describe('with ingress installed with ip & jupyter installable', () => {
it('renders hostname active input', () => {
2021-03-11 19:13:27 +05:30
createComponent({
2020-06-23 00:09:42 +05:30
applications: {
ingress: {
title: 'Ingress',
status: 'installed',
externalIp: '1.1.1.1',
2018-11-08 19:23:39 +05:30
},
2020-06-23 00:09:42 +05:30
},
2018-11-08 19:23:39 +05:30
});
2020-06-23 00:09:42 +05:30
expect(
wrapper.find('.js-cluster-application-row-jupyter .js-hostname').attributes('readonly'),
).toEqual(undefined);
});
});
2018-11-08 19:23:39 +05:30
2020-06-23 00:09:42 +05:30
describe('with ingress installed without external ip', () => {
it('does not render hostname input', () => {
2021-03-11 19:13:27 +05:30
createComponent({
2020-06-23 00:09:42 +05:30
applications: {
ingress: { title: 'Ingress', status: 'installed' },
},
2018-11-08 19:23:39 +05:30
});
2020-06-23 00:09:42 +05:30
expect(wrapper.find('.js-cluster-application-row-jupyter .js-hostname').exists()).toBe(
false,
);
});
});
2018-11-08 19:23:39 +05:30
2020-06-23 00:09:42 +05:30
describe('with ingress & jupyter installed', () => {
it('renders readonly input', () => {
2021-03-11 19:13:27 +05:30
createComponent({
2020-06-23 00:09:42 +05:30
applications: {
2020-10-24 23:57:45 +05:30
ingress: {
title: 'Ingress',
status: 'installed',
externalIp: '1.1.1.1',
},
2020-06-23 00:09:42 +05:30
jupyter: { title: 'JupyterHub', status: 'installed', hostname: '' },
},
2018-11-08 19:23:39 +05:30
});
2020-06-23 00:09:42 +05:30
expect(
wrapper.find('.js-cluster-application-row-jupyter .js-hostname').attributes('readonly'),
).toEqual('readonly');
2018-11-08 19:23:39 +05:30
});
2020-06-23 00:09:42 +05:30
});
2018-11-08 19:23:39 +05:30
2020-06-23 00:09:42 +05:30
describe('without ingress installed', () => {
beforeEach(() => {
2021-03-11 19:13:27 +05:30
createComponent();
2020-06-23 00:09:42 +05:30
});
2018-11-08 19:23:39 +05:30
2020-06-23 00:09:42 +05:30
it('does not render input', () => {
expect(wrapper.find('.js-cluster-application-row-jupyter .js-hostname').exists()).toBe(
false,
);
});
2018-11-08 19:23:39 +05:30
});
2018-03-17 18:26:18 +05:30
});
2019-07-07 11:18:12 +05:30
2020-06-23 00:09:42 +05:30
describe('Prometheus application', () => {
it('shows the correct description', () => {
2021-03-11 19:13:27 +05:30
createComponent();
2020-06-23 00:09:42 +05:30
expect(findByTestId('prometheusDescription').element).toMatchSnapshot();
});
});
2019-07-07 11:18:12 +05:30
describe('Knative application', () => {
2020-04-22 19:07:51 +05:30
const availableDomain = {
id: 4,
domain: 'newhostname.com',
};
2019-09-04 21:01:54 +05:30
const propsData = {
applications: {
knative: {
title: 'Knative',
hostname: 'example.com',
status: 'installed',
externalIp: '1.1.1.1',
installed: true,
2020-04-22 19:07:51 +05:30
availableDomains: [availableDomain],
pagesDomain: null,
2019-09-04 21:01:54 +05:30
},
},
};
let knativeDomainEditor;
2019-07-07 11:18:12 +05:30
2019-09-04 21:01:54 +05:30
beforeEach(() => {
2021-03-11 19:13:27 +05:30
createShallowComponent(propsData);
2019-09-04 21:01:54 +05:30
jest.spyOn(eventHub, '$emit');
2019-07-07 11:18:12 +05:30
2019-09-04 21:01:54 +05:30
knativeDomainEditor = wrapper.find(KnativeDomainEditor);
});
2019-07-07 11:18:12 +05:30
2020-06-23 00:09:42 +05:30
it('shows the correct description', async () => {
2021-03-11 19:13:27 +05:30
createComponent();
2020-06-23 00:09:42 +05:30
wrapper.setProps({
providerType: PROVIDER_TYPE.GCP,
preInstalledKnative: true,
});
await wrapper.vm.$nextTick();
2021-01-29 00:20:46 +05:30
expect(findByTestId('installed-via').element).toMatchSnapshot();
2019-09-04 21:01:54 +05:30
});
2019-07-07 11:18:12 +05:30
2019-09-04 21:01:54 +05:30
it('emits saveKnativeDomain event when knative domain editor emits save event', () => {
2020-04-22 19:07:51 +05:30
propsData.applications.knative.hostname = availableDomain.domain;
propsData.applications.knative.pagesDomain = availableDomain;
knativeDomainEditor.vm.$emit('save');
2019-07-07 11:18:12 +05:30
2019-09-04 21:01:54 +05:30
expect(eventHub.$emit).toHaveBeenCalledWith('saveKnativeDomain', {
id: 'knative',
2020-04-22 19:07:51 +05:30
params: {
hostname: availableDomain.domain,
pages_domain_id: availableDomain.id,
},
});
});
it('emits saveKnativeDomain event when knative domain editor emits save event with custom domain', () => {
const newHostName = 'someothernewhostname.com';
propsData.applications.knative.hostname = newHostName;
propsData.applications.knative.pagesDomain = null;
knativeDomainEditor.vm.$emit('save');
expect(eventHub.$emit).toHaveBeenCalledWith('saveKnativeDomain', {
id: 'knative',
params: {
hostname: newHostName,
pages_domain_id: undefined,
},
2019-07-07 11:18:12 +05:30
});
2019-09-04 21:01:54 +05:30
});
2019-07-07 11:18:12 +05:30
2019-09-04 21:01:54 +05:30
it('emits setKnativeHostname event when knative domain editor emits change event', () => {
2020-04-22 19:07:51 +05:30
wrapper.find(KnativeDomainEditor).vm.$emit('set', {
domain: availableDomain.domain,
domainId: availableDomain.id,
});
2019-07-07 11:18:12 +05:30
2020-04-22 19:07:51 +05:30
expect(eventHub.$emit).toHaveBeenCalledWith('setKnativeDomain', {
2019-09-04 21:01:54 +05:30
id: 'knative',
2020-04-22 19:07:51 +05:30
domain: availableDomain.domain,
domainId: availableDomain.id,
2019-07-07 11:18:12 +05:30
});
});
});
2019-12-26 22:10:19 +05:30
describe('Crossplane application', () => {
const propsData = {
applications: {
crossplane: {
title: 'Crossplane',
stack: {
code: '',
},
},
},
};
2021-03-11 19:13:27 +05:30
beforeEach(() => createShallowComponent(propsData));
2020-06-23 00:09:42 +05:30
2019-12-26 22:10:19 +05:30
it('renders the correct Component', () => {
const crossplane = wrapper.find(CrossplaneProviderStack);
expect(crossplane.exists()).toBe(true);
});
2020-06-23 00:09:42 +05:30
it('shows the correct description', () => {
2021-03-11 19:13:27 +05:30
createComponent();
2020-06-23 00:09:42 +05:30
expect(findByTestId('crossplaneDescription').element).toMatchSnapshot();
});
2019-12-26 22:10:19 +05:30
});
describe('Elastic Stack application', () => {
2020-03-13 15:44:24 +05:30
describe('with elastic stack installable', () => {
2020-10-24 23:57:45 +05:30
it('renders the install button enabled', () => {
2021-03-11 19:13:27 +05:30
createComponent();
2019-12-26 22:10:19 +05:30
expect(
2020-06-23 00:09:42 +05:30
wrapper
.find(
2020-03-13 15:44:24 +05:30
'.js-cluster-application-row-elastic_stack .js-cluster-application-install-button',
)
2020-06-23 00:09:42 +05:30
.attributes('disabled'),
2020-10-24 23:57:45 +05:30
).toBeUndefined();
2019-12-26 22:10:19 +05:30
});
});
2020-03-13 15:44:24 +05:30
describe('elastic stack installed', () => {
it('renders uninstall button', () => {
2021-03-11 19:13:27 +05:30
createComponent({
2019-12-26 22:10:19 +05:30
applications: {
2020-03-13 15:44:24 +05:30
elastic_stack: { title: 'Elastic Stack', status: 'installed' },
2019-12-26 22:10:19 +05:30
},
});
expect(
2020-06-23 00:09:42 +05:30
wrapper
.find(
2019-12-26 22:10:19 +05:30
'.js-cluster-application-row-elastic_stack .js-cluster-application-install-button',
)
2020-06-23 00:09:42 +05:30
.attributes('disabled'),
2019-12-26 22:10:19 +05:30
).toEqual('disabled');
});
});
});
2020-05-24 23:13:21 +05:30
describe('Fluentd application', () => {
2021-03-11 19:13:27 +05:30
beforeEach(() => createShallowComponent());
2020-05-24 23:13:21 +05:30
it('renders the correct Component', () => {
2020-06-23 00:09:42 +05:30
expect(wrapper.find(FluentdOutputSettings).exists()).toBe(true);
2020-05-24 23:13:21 +05:30
});
});
2020-10-24 23:57:45 +05:30
describe('Cilium application', () => {
it('shows the correct description', () => {
2021-03-11 19:13:27 +05:30
createComponent({ propsData: { ciliumHelpPath: 'cilium-help-path' } });
2020-10-24 23:57:45 +05:30
expect(findByTestId('ciliumDescription').element).toMatchSnapshot();
});
});
2018-03-17 18:26:18 +05:30
});