summaryrefslogtreecommitdiff
path: root/spec/frontend/pages/projects/shared/permissions/components/project_setting_row_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/pages/projects/shared/permissions/components/project_setting_row_spec.js')
-rw-r--r--spec/frontend/pages/projects/shared/permissions/components/project_setting_row_spec.js33
1 files changed, 15 insertions, 18 deletions
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', () => {