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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-07-14 03:09:46 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-07-14 03:09:46 +0300
commitb941629bbf312ed71c6065e2c3a6ef5a35dfa19c (patch)
treeccf5c8ecee54f5f651ec6a8346bf2e74592bac60 /spec/frontend/clusters_list
parent0698388e65ed3556a11ec7eb2e76e7b7f9f0489e (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/clusters_list')
-rw-r--r--spec/frontend/clusters_list/components/ancestor_notice_spec.js51
1 files changed, 51 insertions, 0 deletions
diff --git a/spec/frontend/clusters_list/components/ancestor_notice_spec.js b/spec/frontend/clusters_list/components/ancestor_notice_spec.js
new file mode 100644
index 00000000000..c931912eaf9
--- /dev/null
+++ b/spec/frontend/clusters_list/components/ancestor_notice_spec.js
@@ -0,0 +1,51 @@
+import AncestorNotice from '~/clusters_list/components/ancestor_notice.vue';
+import ClusterStore from '~/clusters_list/store';
+import { shallowMount } from '@vue/test-utils';
+import { GlLink, GlSprintf } from '@gitlab/ui';
+
+describe('ClustersAncestorNotice', () => {
+ let store;
+ let wrapper;
+
+ const createWrapper = () => {
+ store = ClusterStore({ ancestorHelperPath: '/some/ancestor/path' });
+ wrapper = shallowMount(AncestorNotice, { store, stubs: { GlSprintf } });
+ return wrapper.vm.$nextTick();
+ };
+
+ beforeEach(() => {
+ return createWrapper();
+ });
+
+ afterEach(() => {
+ wrapper.destroy();
+ });
+
+ describe('when cluster does not have ancestors', () => {
+ beforeEach(() => {
+ store.state.hasAncestorClusters = false;
+ return wrapper.vm.$nextTick();
+ });
+
+ it('displays no notice', () => {
+ expect(wrapper.isEmpty()).toBe(true);
+ });
+ });
+
+ describe('when cluster has ancestors', () => {
+ beforeEach(() => {
+ store.state.hasAncestorClusters = true;
+ return wrapper.vm.$nextTick();
+ });
+
+ it('displays notice text', () => {
+ expect(wrapper.text()).toContain(
+ 'Clusters are utilized by selecting the nearest ancestor with a matching environment scope. For example, project clusters will override group clusters.',
+ );
+ });
+
+ it('displays link', () => {
+ expect(wrapper.contains(GlLink)).toBe(true);
+ });
+ });
+});