diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-16 21:08:34 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-16 21:08:34 +0300 |
commit | cc9ff71e31ecc954f819741ba1285b1b9adbf3b9 (patch) | |
tree | 5f1ff13cc95f2b1860419c45b8def31cde56d1f9 /spec/frontend/api | |
parent | f01d3c8c095e70981ffc1d20c050c153f3766421 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/api')
-rw-r--r-- | spec/frontend/api/alert_management_alerts_api_spec.js | 3 | ||||
-rw-r--r-- | spec/frontend/api/groups_api_spec.js | 13 | ||||
-rw-r--r-- | spec/frontend/api/packages_api_spec.js | 12 | ||||
-rw-r--r-- | spec/frontend/api/projects_api_spec.js | 3 | ||||
-rw-r--r-- | spec/frontend/api/tags_api_spec.js | 3 | ||||
-rw-r--r-- | spec/frontend/api/user_api_spec.js | 3 |
6 files changed, 8 insertions, 29 deletions
diff --git a/spec/frontend/api/alert_management_alerts_api_spec.js b/spec/frontend/api/alert_management_alerts_api_spec.js index 507f659a170..86052a05b76 100644 --- a/spec/frontend/api/alert_management_alerts_api_spec.js +++ b/spec/frontend/api/alert_management_alerts_api_spec.js @@ -9,7 +9,6 @@ import { describe('~/api/alert_management_alerts_api.js', () => { let mock; - let originalGon; const projectId = 1; const alertIid = 2; @@ -19,13 +18,11 @@ describe('~/api/alert_management_alerts_api.js', () => { beforeEach(() => { mock = new MockAdapter(axios); - originalGon = window.gon; window.gon = { api_version: 'v4' }; }); afterEach(() => { mock.restore(); - window.gon = originalGon; }); describe('fetchAlertMetricImages', () => { diff --git a/spec/frontend/api/groups_api_spec.js b/spec/frontend/api/groups_api_spec.js index 0315db02cf2..642edb33624 100644 --- a/spec/frontend/api/groups_api_spec.js +++ b/spec/frontend/api/groups_api_spec.js @@ -10,23 +10,18 @@ const mockUrlRoot = '/gitlab'; const mockGroupId = '99'; describe('GroupsApi', () => { - let originalGon; let mock; - const dummyGon = { - api_version: mockApiVersion, - relative_url_root: mockUrlRoot, - }; - beforeEach(() => { mock = new MockAdapter(axios); - originalGon = window.gon; - window.gon = { ...dummyGon }; + window.gon = { + api_version: mockApiVersion, + relative_url_root: mockUrlRoot, + }; }); afterEach(() => { mock.restore(); - window.gon = originalGon; }); describe('updateGroup', () => { diff --git a/spec/frontend/api/packages_api_spec.js b/spec/frontend/api/packages_api_spec.js index 5f517bcf358..37c4b926ec2 100644 --- a/spec/frontend/api/packages_api_spec.js +++ b/spec/frontend/api/packages_api_spec.js @@ -6,22 +6,18 @@ import { HTTP_STATUS_OK } from '~/lib/utils/http_status'; describe('Api', () => { const dummyApiVersion = 'v3000'; const dummyUrlRoot = '/gitlab'; - const dummyGon = { - api_version: dummyApiVersion, - relative_url_root: dummyUrlRoot, - }; - let originalGon; let mock; beforeEach(() => { mock = new MockAdapter(axios); - originalGon = window.gon; - window.gon = { ...dummyGon }; + window.gon = { + api_version: dummyApiVersion, + relative_url_root: dummyUrlRoot, + }; }); afterEach(() => { mock.restore(); - window.gon = originalGon; }); describe('packages', () => { diff --git a/spec/frontend/api/projects_api_spec.js b/spec/frontend/api/projects_api_spec.js index 2d4ed39dad0..2de56fae0c2 100644 --- a/spec/frontend/api/projects_api_spec.js +++ b/spec/frontend/api/projects_api_spec.js @@ -7,7 +7,6 @@ import { HTTP_STATUS_OK } from '~/lib/utils/http_status'; describe('~/api/projects_api.js', () => { let mock; - let originalGon; const projectId = 1; const setfullPathProjectSearch = (value) => { @@ -17,13 +16,11 @@ describe('~/api/projects_api.js', () => { beforeEach(() => { mock = new MockAdapter(axios); - originalGon = window.gon; window.gon = { api_version: 'v7', features: { fullPathProjectSearch: true } }; }); afterEach(() => { mock.restore(); - window.gon = originalGon; }); describe('getProjects', () => { diff --git a/spec/frontend/api/tags_api_spec.js b/spec/frontend/api/tags_api_spec.js index af3533f52b7..0a1177d4f60 100644 --- a/spec/frontend/api/tags_api_spec.js +++ b/spec/frontend/api/tags_api_spec.js @@ -5,20 +5,17 @@ import { HTTP_STATUS_OK } from '~/lib/utils/http_status'; describe('~/api/tags_api.js', () => { let mock; - let originalGon; const projectId = 1; beforeEach(() => { mock = new MockAdapter(axios); - originalGon = window.gon; window.gon = { api_version: 'v7' }; }); afterEach(() => { mock.restore(); - window.gon = originalGon; }); describe('getTag', () => { diff --git a/spec/frontend/api/user_api_spec.js b/spec/frontend/api/user_api_spec.js index 4d0252aad23..6636d77a09b 100644 --- a/spec/frontend/api/user_api_spec.js +++ b/spec/frontend/api/user_api_spec.js @@ -12,19 +12,16 @@ import { timeRanges } from '~/vue_shared/constants'; describe('~/api/user_api', () => { let axiosMock; - let originalGon; beforeEach(() => { axiosMock = new MockAdapter(axios); - originalGon = window.gon; window.gon = { api_version: 'v4' }; }); afterEach(() => { axiosMock.restore(); axiosMock.resetHistory(); - window.gon = originalGon; }); describe('followUser', () => { |