diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-02 00:06:43 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-02 00:06:43 +0300 |
commit | 9c4066878fe309781bbadd20f87c223c12dc60f6 (patch) | |
tree | b5a5adefc861696c4ebb75d937fe70b9241d5bdc /spec/frontend/projects | |
parent | 77a73903aa803869d0ab7fe544cc2d8b1a6aa1e0 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/projects')
-rw-r--r-- | spec/frontend/projects/gke_cluster_namespace/gke_cluster_namespace_spec.js | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/spec/frontend/projects/gke_cluster_namespace/gke_cluster_namespace_spec.js b/spec/frontend/projects/gke_cluster_namespace/gke_cluster_namespace_spec.js deleted file mode 100644 index 7b8df03d3c3..00000000000 --- a/spec/frontend/projects/gke_cluster_namespace/gke_cluster_namespace_spec.js +++ /dev/null @@ -1,61 +0,0 @@ -import initGkeNamespace from '~/projects/gke_cluster_namespace'; - -describe('GKE cluster namespace', () => { - const changeEvent = new Event('change'); - const isHidden = el => el.classList.contains('hidden'); - const hasDisabledInput = el => el.querySelector('input').disabled; - - let glManagedCheckbox; - let selfManaged; - let glManaged; - - beforeEach(() => { - setFixtures(` - <input class="js-gl-managed" type="checkbox" value="1" checked /> - <div class="js-namespace"> - <input type="text" /> - </div> - <div class="js-namespace-prefixed"> - <input type="text" /> - </div> - `); - - glManagedCheckbox = document.querySelector('.js-gl-managed'); - selfManaged = document.querySelector('.js-namespace'); - glManaged = document.querySelector('.js-namespace-prefixed'); - - initGkeNamespace(); - }); - - describe('GKE cluster namespace toggles', () => { - it('initially displays the GitLab-managed label and input', () => { - expect(isHidden(glManaged)).toEqual(false); - expect(hasDisabledInput(glManaged)).toEqual(false); - - expect(isHidden(selfManaged)).toEqual(true); - expect(hasDisabledInput(selfManaged)).toEqual(true); - }); - - it('displays the self-managed label and input when the Gitlab-managed checkbox is unchecked', () => { - glManagedCheckbox.checked = false; - glManagedCheckbox.dispatchEvent(changeEvent); - - expect(isHidden(glManaged)).toEqual(true); - expect(hasDisabledInput(glManaged)).toEqual(true); - - expect(isHidden(selfManaged)).toEqual(false); - expect(hasDisabledInput(selfManaged)).toEqual(false); - }); - - it('displays the GitLab-managed label and input when the Gitlab-managed checkbox is checked', () => { - glManagedCheckbox.checked = true; - glManagedCheckbox.dispatchEvent(changeEvent); - - expect(isHidden(glManaged)).toEqual(false); - expect(hasDisabledInput(glManaged)).toEqual(false); - - expect(isHidden(selfManaged)).toEqual(true); - expect(hasDisabledInput(selfManaged)).toEqual(true); - }); - }); -}); |