From a7b3560714b4d9cc4ab32dffcd1f74a284b93580 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Fri, 18 Feb 2022 09:45:46 +0000 Subject: Add latest changes from gitlab-org/gitlab@14-8-stable-ee --- .../components/project_setting_row_spec.js | 33 ++++++++++------------ 1 file changed, 15 insertions(+), 18 deletions(-) (limited to 'spec/frontend/pages/projects/shared/permissions/components/project_setting_row_spec.js') diff --git a/spec/frontend/pages/projects/shared/permissions/components/project_setting_row_spec.js b/spec/frontend/pages/projects/shared/permissions/components/project_setting_row_spec.js index 7cbcbdcdd1f..6230809a6aa 100644 --- a/spec/frontend/pages/projects/shared/permissions/components/project_setting_row_spec.js +++ b/spec/frontend/pages/projects/shared/permissions/components/project_setting_row_spec.js @@ -1,5 +1,6 @@ import { shallowMount } from '@vue/test-utils'; +import { nextTick } from 'vue'; import projectSettingRow from '~/pages/projects/shared/permissions/components/project_setting_row.vue'; describe('Project Setting Row', () => { @@ -18,43 +19,39 @@ describe('Project Setting Row', () => { wrapper.destroy(); }); - it('should show the label if it is set', () => { + it('should show the label if it is set', async () => { wrapper.setProps({ label: 'Test label' }); - return wrapper.vm.$nextTick(() => { - expect(wrapper.find('label').text()).toEqual('Test label'); - }); + await nextTick(); + expect(wrapper.find('label').text()).toEqual('Test label'); }); it('should hide the label if it is not set', () => { expect(wrapper.find('label').exists()).toBe(false); }); - it('should show the help icon with the correct help path if it is set', () => { + it('should show the help icon with the correct help path if it is set', async () => { wrapper.setProps({ label: 'Test label', helpPath: '/123' }); - return wrapper.vm.$nextTick(() => { - const link = wrapper.find('a'); + await nextTick(); + const link = wrapper.find('a'); - expect(link.exists()).toBe(true); - expect(link.attributes().href).toEqual('/123'); - }); + expect(link.exists()).toBe(true); + expect(link.attributes().href).toEqual('/123'); }); - it('should hide the help icon if no help path is set', () => { + it('should hide the help icon if no help path is set', async () => { wrapper.setProps({ label: 'Test label' }); - return wrapper.vm.$nextTick(() => { - expect(wrapper.find('a').exists()).toBe(false); - }); + await nextTick(); + expect(wrapper.find('a').exists()).toBe(false); }); - it('should show the help text if it is set', () => { + it('should show the help text if it is set', async () => { wrapper.setProps({ helpText: 'Test text' }); - return wrapper.vm.$nextTick(() => { - expect(wrapper.find('span').text()).toEqual('Test text'); - }); + await nextTick(); + expect(wrapper.find('span').text()).toEqual('Test text'); }); it('should hide the help text if it is set', () => { -- cgit v1.2.1