diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-21 06:10:27 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-21 06:10:27 +0300 |
commit | 6575e44cae996d484cbba87a078022768a116db9 (patch) | |
tree | 384f6399d1bea03503354b88ce151867ce4daa1b /spec | |
parent | 019109eac9cbddc6149af0adeff1aad8195b1457 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
-rw-r--r-- | spec/frontend/commit/commit_pipeline_status_component_spec.js | 4 | ||||
-rw-r--r-- | spec/frontend/logs/stores/actions_spec.js | 4 | ||||
-rw-r--r-- | spec/frontend/persistent_user_callout_spec.js | 15 | ||||
-rw-r--r-- | spec/frontend/sidebar/lock/edit_form_buttons_spec.js | 10 | ||||
-rw-r--r-- | spec/frontend/snippets/components/edit_spec.js | 12 | ||||
-rw-r--r-- | spec/graphql/types/ci/stage_type_spec.rb | 1 |
6 files changed, 25 insertions, 21 deletions
diff --git a/spec/frontend/commit/commit_pipeline_status_component_spec.js b/spec/frontend/commit/commit_pipeline_status_component_spec.js index a56f761269a..8082b8524e7 100644 --- a/spec/frontend/commit/commit_pipeline_status_component_spec.js +++ b/spec/frontend/commit/commit_pipeline_status_component_spec.js @@ -2,7 +2,7 @@ import { GlLoadingIcon } from '@gitlab/ui'; import { shallowMount } from '@vue/test-utils'; import Visibility from 'visibilityjs'; import { getJSONFixture } from 'helpers/fixtures'; -import { deprecatedCreateFlash as flash } from '~/flash'; +import createFlash from '~/flash'; import Poll from '~/lib/utils/poll'; import CommitPipelineStatus from '~/projects/tree/components/commit_pipeline_status_component.vue'; import CiIcon from '~/vue_shared/components/ci_icon.vue'; @@ -170,7 +170,7 @@ describe('Commit pipeline status component', () => { }); it('displays flash error message', () => { - expect(flash).toHaveBeenCalled(); + expect(createFlash).toHaveBeenCalled(); }); }); }); diff --git a/spec/frontend/logs/stores/actions_spec.js b/spec/frontend/logs/stores/actions_spec.js index 9307a3b62fb..61658257484 100644 --- a/spec/frontend/logs/stores/actions_spec.js +++ b/spec/frontend/logs/stores/actions_spec.js @@ -1,6 +1,6 @@ import MockAdapter from 'axios-mock-adapter'; import testAction from 'helpers/vuex_action_helper'; -import { deprecatedCreateFlash as flash } from '~/flash'; +import createFlash from '~/flash'; import axios from '~/lib/utils/axios_utils'; import { convertToFixedRange } from '~/lib/utils/datetime_range'; import { TOKEN_TYPE_POD_NAME } from '~/logs/constants'; @@ -76,7 +76,7 @@ describe('Logs Store actions', () => { }); afterEach(() => { - flash.mockClear(); + createFlash.mockClear(); }); describe('setInitData', () => { diff --git a/spec/frontend/persistent_user_callout_spec.js b/spec/frontend/persistent_user_callout_spec.js index 403142d7ff7..1e51ddf909a 100644 --- a/spec/frontend/persistent_user_callout_spec.js +++ b/spec/frontend/persistent_user_callout_spec.js @@ -1,6 +1,6 @@ import MockAdapter from 'axios-mock-adapter'; import waitForPromises from 'helpers/wait_for_promises'; -import { deprecatedCreateFlash as Flash } from '~/flash'; +import createFlash from '~/flash'; import axios from '~/lib/utils/axios_utils'; import PersistentUserCallout from '~/persistent_user_callout'; @@ -96,9 +96,9 @@ describe('PersistentUserCallout', () => { return waitForPromises().then(() => { expect(persistentUserCallout.container.remove).not.toHaveBeenCalled(); - expect(Flash).toHaveBeenCalledWith( - 'An error occurred while dismissing the alert. Refresh the page and try again.', - ); + expect(createFlash).toHaveBeenCalledWith({ + message: 'An error occurred while dismissing the alert. Refresh the page and try again.', + }); }); }); }); @@ -203,9 +203,10 @@ describe('PersistentUserCallout', () => { return waitForPromises().then(() => { expect(window.location.assign).not.toHaveBeenCalled(); - expect(Flash).toHaveBeenCalledWith( - 'An error occurred while acknowledging the notification. Refresh the page and try again.', - ); + expect(createFlash).toHaveBeenCalledWith({ + message: + 'An error occurred while acknowledging the notification. Refresh the page and try again.', + }); }); }); }); diff --git a/spec/frontend/sidebar/lock/edit_form_buttons_spec.js b/spec/frontend/sidebar/lock/edit_form_buttons_spec.js index 49283ea99cf..1673425947e 100644 --- a/spec/frontend/sidebar/lock/edit_form_buttons_spec.js +++ b/spec/frontend/sidebar/lock/edit_form_buttons_spec.js @@ -1,5 +1,5 @@ import { mount } from '@vue/test-utils'; -import { deprecatedCreateFlash as flash } from '~/flash'; +import createFlash from '~/flash'; import { createStore as createMrStore } from '~/mr_notes/stores'; import createStore from '~/notes/stores'; import EditFormButtons from '~/sidebar/components/lock/edit_form_buttons.vue'; @@ -130,7 +130,7 @@ describe('EditFormButtons', () => { }); it('does not flash an error message', () => { - expect(flash).not.toHaveBeenCalled(); + expect(createFlash).not.toHaveBeenCalled(); }); }); @@ -165,9 +165,9 @@ describe('EditFormButtons', () => { }); it('calls flash with the correct message', () => { - expect(flash).toHaveBeenCalledWith( - `Something went wrong trying to change the locked state of this ${issuableDisplayName}`, - ); + expect(createFlash).toHaveBeenCalledWith({ + message: `Something went wrong trying to change the locked state of this ${issuableDisplayName}`, + }); }); }); }); diff --git a/spec/frontend/snippets/components/edit_spec.js b/spec/frontend/snippets/components/edit_spec.js index efdb52cfcd9..450f8e06b2a 100644 --- a/spec/frontend/snippets/components/edit_spec.js +++ b/spec/frontend/snippets/components/edit_spec.js @@ -8,7 +8,7 @@ import createMockApollo from 'helpers/mock_apollo_helper'; import waitForPromises from 'helpers/wait_for_promises'; import GetSnippetQuery from 'shared_queries/snippet/snippet.query.graphql'; import UnsolvedCaptchaError from '~/captcha/unsolved_captcha_error'; -import { deprecatedCreateFlash as Flash } from '~/flash'; +import createFlash from '~/flash'; import * as urlUtils from '~/lib/utils/url_utility'; import SnippetEditApp from '~/snippets/components/edit.vue'; import SnippetBlobActionsEdit from '~/snippets/components/snippet_blob_actions_edit.vue'; @@ -319,7 +319,9 @@ describe('Snippet Edit app', () => { }); expect(urlUtils.redirectTo).not.toHaveBeenCalled(); - expect(Flash).toHaveBeenCalledWith(expectMessage); + expect(createFlash).toHaveBeenCalledWith({ + message: expectMessage, + }); }, ); @@ -337,9 +339,9 @@ describe('Snippet Edit app', () => { it('should flash', () => { // Apollo automatically wraps the resolver's error in a NetworkError - expect(Flash).toHaveBeenCalledWith( - `Can't update snippet: Network error: ${error.message}`, - ); + expect(createFlash).toHaveBeenCalledWith({ + message: `Can't update snippet: Network error: ${error.message}`, + }); }); it('should console error', () => { diff --git a/spec/graphql/types/ci/stage_type_spec.rb b/spec/graphql/types/ci/stage_type_spec.rb index cb8c1cb02cd..b5752785923 100644 --- a/spec/graphql/types/ci/stage_type_spec.rb +++ b/spec/graphql/types/ci/stage_type_spec.rb @@ -10,6 +10,7 @@ RSpec.describe Types::Ci::StageType do name groups detailedStatus + status jobs ] |