diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-24 21:06:05 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-24 21:06:05 +0300 |
commit | 2ed368929ab5094fec5da8038f723463596a80cf (patch) | |
tree | aec98d50349b0e9a490db0099253b801b2d1a9ea /spec/javascripts | |
parent | f1a5755898e865428c923587402fd965b601c4ea (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/javascripts')
5 files changed, 22 insertions, 9 deletions
diff --git a/spec/javascripts/create_cluster/gke_cluster/components/gke_project_id_dropdown_spec.js b/spec/javascripts/create_cluster/gke_cluster/components/gke_project_id_dropdown_spec.js index 809da3f9088..016ecfb35b8 100644 --- a/spec/javascripts/create_cluster/gke_cluster/components/gke_project_id_dropdown_spec.js +++ b/spec/javascripts/create_cluster/gke_cluster/components/gke_project_id_dropdown_spec.js @@ -4,6 +4,7 @@ import { createStore } from '~/create_cluster/gke_cluster/store'; import { SET_PROJECTS } from '~/create_cluster/gke_cluster/store/mutation_types'; import { mountComponentWithStore } from 'spec/helpers/vue_mount_component_helper'; import { emptyProjectMock, selectedProjectMock } from '../mock_data'; +import { gapi } from '../helpers'; const componentConfig = { docsUrl: 'https://console.cloud.google.com/home/dashboard', @@ -32,6 +33,16 @@ describe('GkeProjectIdDropdown', () => { let vm; let store; + let originalGapi; + beforeAll(() => { + originalGapi = window.gapi; + window.gapi = gapi(); + }); + + afterAll(() => { + window.gapi = originalGapi; + }); + beforeEach(() => { store = createStore(); vm = createComponent(store); diff --git a/spec/javascripts/create_cluster/gke_cluster/stores/actions_spec.js b/spec/javascripts/create_cluster/gke_cluster/stores/actions_spec.js index a7591cc38c7..7ceaeace82f 100644 --- a/spec/javascripts/create_cluster/gke_cluster/stores/actions_spec.js +++ b/spec/javascripts/create_cluster/gke_cluster/stores/actions_spec.js @@ -64,7 +64,15 @@ describe('GCP Cluster Dropdown Store Actions', () => { }); describe('async fetch methods', () => { - window.gapi = gapi(); + let originalGapi; + beforeAll(() => { + originalGapi = window.gapi; + window.gapi = gapi(); + }); + + afterAll(() => { + window.gapi = originalGapi; + }); describe('fetchProjects', () => { it('fetches projects from Google API', done => { diff --git a/spec/javascripts/monitoring/components/dashboard_spec.js b/spec/javascripts/monitoring/components/dashboard_spec.js index 6ce32d21f45..87aa4ba500d 100644 --- a/spec/javascripts/monitoring/components/dashboard_spec.js +++ b/spec/javascripts/monitoring/components/dashboard_spec.js @@ -527,7 +527,6 @@ describe('Dashboard', () => { component.$store.dispatch('monitoringDashboard/setFeatureFlags', { prometheusEndpoint: false, - multipleDashboardsEnabled: true, }); component.$store.commit( diff --git a/spec/javascripts/monitoring/store/actions_spec.js b/spec/javascripts/monitoring/store/actions_spec.js index 955a39e03a5..1bd74f59282 100644 --- a/spec/javascripts/monitoring/store/actions_spec.js +++ b/spec/javascripts/monitoring/store/actions_spec.js @@ -240,8 +240,6 @@ describe('Monitoring store actions', () => { const response = metricsDashboardResponse; response.all_dashboards = dashboardGitResponse; - state.multipleDashboardsEnabled = true; - receiveMetricsDashboardSuccess({ state, commit, dispatch }, { response, params }); expect(commit).toHaveBeenCalledWith(types.SET_ALL_DASHBOARDS, dashboardGitResponse); diff --git a/spec/javascripts/vue_mr_widget/components/states/mr_widget_wip_spec.js b/spec/javascripts/vue_mr_widget/components/states/mr_widget_wip_spec.js index 7b1d589dcf8..5844dad42ff 100644 --- a/spec/javascripts/vue_mr_widget/components/states/mr_widget_wip_spec.js +++ b/spec/javascripts/vue_mr_widget/components/states/mr_widget_wip_spec.js @@ -47,7 +47,7 @@ describe('Wip', () => { it('should make a request to service and handle response', done => { const vm = createComponent(); - spyOn(window, 'Flash').and.returnValue(true); + const flashSpy = spyOnDependency(WorkInProgress, 'createFlash').and.returnValue(true); spyOn(eventHub, '$emit'); spyOn(vm.service, 'removeWIP').and.returnValue( new Promise(resolve => { @@ -61,10 +61,7 @@ describe('Wip', () => { setTimeout(() => { expect(vm.isMakingRequest).toBeTruthy(); expect(eventHub.$emit).toHaveBeenCalledWith('UpdateWidgetData', mrObj); - expect(window.Flash).toHaveBeenCalledWith( - 'The merge request can now be merged.', - 'notice', - ); + expect(flashSpy).toHaveBeenCalledWith('The merge request can now be merged.', 'notice'); done(); }, 333); }); |