Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/clusters/clusters_bundle_spec.js')
-rw-r--r--spec/frontend/clusters/clusters_bundle_spec.js72
1 files changed, 1 insertions, 71 deletions
diff --git a/spec/frontend/clusters/clusters_bundle_spec.js b/spec/frontend/clusters/clusters_bundle_spec.js
index a9870e4db57..d3277cdb7cc 100644
--- a/spec/frontend/clusters/clusters_bundle_spec.js
+++ b/spec/frontend/clusters/clusters_bundle_spec.js
@@ -1,14 +1,8 @@
import MockAdapter from 'axios-mock-adapter';
-import $ from 'jquery';
import { loadHTMLFixture } from 'helpers/fixtures';
import { setTestTimeout } from 'helpers/timeout';
import Clusters from '~/clusters/clusters_bundle';
-import {
- APPLICATION_STATUS,
- INGRESS_DOMAIN_SUFFIX,
- APPLICATIONS,
- RUNNER,
-} from '~/clusters/constants';
+import { APPLICATION_STATUS, APPLICATIONS, RUNNER } from '~/clusters/constants';
import axios from '~/lib/utils/axios_utils';
import initProjectSelectDropdown from '~/project_select';
@@ -63,25 +57,6 @@ describe('Clusters', () => {
});
});
- describe('toggle', () => {
- it('should update the button and the input field on click', done => {
- const toggleButton = document.querySelector(
- '.js-cluster-enable-toggle-area .js-project-feature-toggle',
- );
- const toggleInput = document.querySelector(
- '.js-cluster-enable-toggle-area .js-project-feature-toggle-input',
- );
-
- $(toggleInput).one('trigger-change', () => {
- expect(toggleButton.classList).not.toContain('is-checked');
- expect(toggleInput.getAttribute('value')).toEqual('false');
- done();
- });
-
- toggleButton.click();
- });
- });
-
describe('checkForNewInstalls', () => {
const INITIAL_APP_MAP = {
helm: { status: null, title: 'Helm Tiller' },
@@ -328,7 +303,6 @@ describe('Clusters', () => {
return promise.then(() => {
expect(cluster.store.state.applications.helm.status).toEqual(INSTALLED);
expect(cluster.store.state.applications.helm.uninstallFailed).toBe(true);
-
expect(cluster.store.state.applications.helm.requestReason).toBeDefined();
});
});
@@ -354,10 +328,8 @@ describe('Clusters', () => {
describe('handleClusterStatusSuccess', () => {
beforeEach(() => {
jest.spyOn(cluster.store, 'updateStateFromServer').mockReturnThis();
- jest.spyOn(cluster, 'toggleIngressDomainHelpText').mockReturnThis();
jest.spyOn(cluster, 'checkForNewInstalls').mockReturnThis();
jest.spyOn(cluster, 'updateContainer').mockReturnThis();
-
cluster.handleClusterStatusSuccess({ data: {} });
});
@@ -369,53 +341,11 @@ describe('Clusters', () => {
expect(cluster.checkForNewInstalls).toHaveBeenCalled();
});
- it('toggles ingress domain help text', () => {
- expect(cluster.toggleIngressDomainHelpText).toHaveBeenCalled();
- });
-
it('updates message containers', () => {
expect(cluster.updateContainer).toHaveBeenCalled();
});
});
- describe('toggleIngressDomainHelpText', () => {
- let ingressPreviousState;
- let ingressNewState;
-
- beforeEach(() => {
- ingressPreviousState = { externalIp: null };
- ingressNewState = { externalIp: '127.0.0.1' };
- });
-
- describe(`when ingress have an external ip assigned`, () => {
- beforeEach(() => {
- cluster.toggleIngressDomainHelpText(ingressPreviousState, ingressNewState);
- });
-
- it('displays custom domain help text', () => {
- expect(cluster.ingressDomainHelpText.classList.contains('hide')).toEqual(false);
- });
-
- it('updates ingress external ip address', () => {
- expect(cluster.ingressDomainSnippet.textContent).toEqual(
- `${ingressNewState.externalIp}${INGRESS_DOMAIN_SUFFIX}`,
- );
- });
- });
-
- describe(`when ingress does not have an external ip assigned`, () => {
- it('hides custom domain help text', () => {
- ingressPreviousState.externalIp = '127.0.0.1';
- ingressNewState.externalIp = null;
- cluster.ingressDomainHelpText.classList.remove('hide');
-
- cluster.toggleIngressDomainHelpText(ingressPreviousState, ingressNewState);
-
- expect(cluster.ingressDomainHelpText.classList.contains('hide')).toEqual(true);
- });
- });
- });
-
describe('updateApplication', () => {
const params = { version: '1.0.0' };
let storeUpdateApplication;