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/monitoring')
-rw-r--r--spec/frontend/monitoring/components/dashboard_spec.js2
-rw-r--r--spec/frontend/monitoring/components/links_section_spec.js10
-rw-r--r--spec/frontend/monitoring/components/variables/text_field_spec.js4
-rw-r--r--spec/frontend/monitoring/pages/dashboard_page_spec.js4
4 files changed, 11 insertions, 9 deletions
diff --git a/spec/frontend/monitoring/components/dashboard_spec.js b/spec/frontend/monitoring/components/dashboard_spec.js
index faa8264b488..9331048bce3 100644
--- a/spec/frontend/monitoring/components/dashboard_spec.js
+++ b/spec/frontend/monitoring/components/dashboard_spec.js
@@ -456,7 +456,7 @@ describe('Dashboard', () => {
it('shows the links section', () => {
expect(wrapper.vm.shouldShowLinksSection).toBe(true);
- expect(wrapper.find(LinksSection)).toExist();
+ expect(wrapper.findComponent(LinksSection).exists()).toBe(true);
});
});
diff --git a/spec/frontend/monitoring/components/links_section_spec.js b/spec/frontend/monitoring/components/links_section_spec.js
index 8fc287c50e4..e37abf6722a 100644
--- a/spec/frontend/monitoring/components/links_section_spec.js
+++ b/spec/frontend/monitoring/components/links_section_spec.js
@@ -1,5 +1,7 @@
import { GlLink } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils';
+import { nextTick } from 'vue';
+
import LinksSection from '~/monitoring/components/links_section.vue';
import { createStore } from '~/monitoring/stores';
@@ -26,12 +28,12 @@ describe('Links Section component', () => {
createShallowWrapper();
});
- it('does not render a section if no links are present', () => {
+ it('does not render a section if no links are present', async () => {
setState();
- return wrapper.vm.$nextTick(() => {
- expect(findLinks()).not.toExist();
- });
+ await nextTick();
+
+ expect(findLinks().length).toBe(0);
});
it('renders a link inside a section', () => {
diff --git a/spec/frontend/monitoring/components/variables/text_field_spec.js b/spec/frontend/monitoring/components/variables/text_field_spec.js
index 28e02dff4bf..c879803fddd 100644
--- a/spec/frontend/monitoring/components/variables/text_field_spec.js
+++ b/spec/frontend/monitoring/components/variables/text_field_spec.js
@@ -15,12 +15,12 @@ describe('Text variable component', () => {
});
};
- const findInput = () => wrapper.find(GlFormInput);
+ const findInput = () => wrapper.findComponent(GlFormInput);
it('renders a text input when all props are passed', () => {
createShallowWrapper();
- expect(findInput()).toExist();
+ expect(findInput().exists()).toBe(true);
});
it('always has a default value', () => {
diff --git a/spec/frontend/monitoring/pages/dashboard_page_spec.js b/spec/frontend/monitoring/pages/dashboard_page_spec.js
index dbe9cc21ad5..c5a8b50ee60 100644
--- a/spec/frontend/monitoring/pages/dashboard_page_spec.js
+++ b/spec/frontend/monitoring/pages/dashboard_page_spec.js
@@ -29,7 +29,7 @@ describe('monitoring/pages/dashboard_page', () => {
});
};
- const findDashboardComponent = () => wrapper.find(Dashboard);
+ const findDashboardComponent = () => wrapper.findComponent(Dashboard);
beforeEach(() => {
buildRouter();
@@ -60,7 +60,7 @@ describe('monitoring/pages/dashboard_page', () => {
smallEmptyState: false,
};
- expect(findDashboardComponent()).toExist();
+ expect(findDashboardComponent().exists()).toBe(true);
expect(allProps).toMatchObject(findDashboardComponent().props());
});
});