summaryrefslogtreecommitdiff
path: root/spec/frontend/artifacts_settings/components/keep_latest_artifact_checkbox_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/artifacts_settings/components/keep_latest_artifact_checkbox_spec.js')
-rw-r--r--spec/frontend/artifacts_settings/components/keep_latest_artifact_checkbox_spec.js20
1 files changed, 9 insertions, 11 deletions
diff --git a/spec/frontend/artifacts_settings/components/keep_latest_artifact_checkbox_spec.js b/spec/frontend/artifacts_settings/components/keep_latest_artifact_checkbox_spec.js
index ca94acfa444..8dafff350f2 100644
--- a/spec/frontend/artifacts_settings/components/keep_latest_artifact_checkbox_spec.js
+++ b/spec/frontend/artifacts_settings/components/keep_latest_artifact_checkbox_spec.js
@@ -1,7 +1,8 @@
import { GlFormCheckbox, GlLink } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils';
-import Vue, { nextTick } from 'vue';
+import Vue from 'vue';
import VueApollo from 'vue-apollo';
+import waitForPromises from 'helpers/wait_for_promises';
import createMockApollo from 'helpers/mock_apollo_helper';
import UpdateKeepLatestArtifactProjectSetting from '~/artifacts_settings/graphql/mutations/update_keep_latest_artifact_project_setting.mutation.graphql';
import GetKeepLatestArtifactApplicationSetting from '~/artifacts_settings/graphql/queries/get_keep_latest_artifact_application_setting.query.graphql';
@@ -28,7 +29,9 @@ const keepLatestArtifactApplicationMock = {
};
const keepLatestArtifactMockResponse = {
- data: { ciCdSettingsUpdate: { errors: [], __typename: 'CiCdSettingsUpdatePayload' } },
+ data: {
+ projectCiCdSettingsUpdate: { errors: [], __typename: 'ProjectCiCdSettingsUpdatePayload' },
+ },
};
describe('Keep latest artifact checkbox', () => {
@@ -78,8 +81,6 @@ describe('Keep latest artifact checkbox', () => {
};
afterEach(() => {
- wrapper.destroy();
- wrapper = null;
apolloProvider = null;
});
@@ -104,19 +105,16 @@ describe('Keep latest artifact checkbox', () => {
});
describe('when application keep latest artifact setting is enabled', () => {
- beforeEach(() => {
+ beforeEach(async () => {
createComponent();
+ await waitForPromises();
});
- it('sets correct setting value in checkbox with query result', async () => {
- await nextTick();
-
+ it('sets correct setting value in checkbox with query result', () => {
expect(wrapper.element).toMatchSnapshot();
});
- it('checkbox is enabled when application setting is enabled', async () => {
- await nextTick();
-
+ it('checkbox is enabled when application setting is enabled', () => {
expect(findCheckbox().attributes('disabled')).toBeUndefined();
});
});