Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
0461c4ef
Commit
0461c4ef
authored
Jan 08, 2020
by
Natalia Tepluhina
Committed by
Phil Hughes
Jan 08, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean unnecessary 'localVue' in various specs on 'spec/frontend'
parent
8e6d4aad
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
20 additions
and
42 deletions
+20
-42
spec/frontend/confidential_merge_request/components/project_form_group_spec.js
...ntial_merge_request/components/project_form_group_spec.js
+4
-6
spec/frontend/contributors/component/contributors_spec.js
spec/frontend/contributors/component/contributors_spec.js
+3
-4
spec/frontend/ide/components/ide_status_list_spec.js
spec/frontend/ide/components/ide_status_list_spec.js
+1
-1
spec/frontend/issuables_list/components/issuables_list_app_spec.js
...tend/issuables_list/components/issuables_list_app_spec.js
+2
-5
spec/frontend/issue_show/components/pinned_links_spec.js
spec/frontend/issue_show/components/pinned_links_spec.js
+2
-5
spec/frontend/operation_settings/components/external_dashboard_spec.js
.../operation_settings/components/external_dashboard_spec.js
+1
-3
spec/frontend/releases/list/components/evidence_block_spec.js
.../frontend/releases/list/components/evidence_block_spec.js
+2
-5
spec/frontend/serverless/components/environment_row_spec.js
spec/frontend/serverless/components/environment_row_spec.js
+5
-13
No files found.
spec/frontend/confidential_merge_request/components/project_form_group_spec.js
View file @
0461c4ef
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
ProjectFormGroup
from
'
~/confidential_merge_request/components/project_form_group.vue
'
;
const
localVue
=
createLocalVue
();
const
mockData
=
[
{
id
:
1
,
...
...
@@ -30,7 +29,6 @@ function factory(projects = mockData) {
mock
.
onGet
(
/api
\/(
.*
)\/
projects
\/
gitlab-org%2Fgitlab-ce
\/
forks/
).
reply
(
200
,
projects
);
vm
=
shallowMount
(
ProjectFormGroup
,
{
localVue
,
propsData
:
{
namespacePath
:
'
gitlab-org
'
,
projectPath
:
'
gitlab-org/gitlab-ce
'
,
...
...
@@ -49,7 +47,7 @@ describe('Confidential merge request project form group component', () => {
it
(
'
renders fork dropdown
'
,
()
=>
{
factory
();
return
localVue
.
nextTick
(()
=>
{
return
vm
.
vm
.
$
nextTick
(()
=>
{
expect
(
vm
.
element
).
toMatchSnapshot
();
});
});
...
...
@@ -57,7 +55,7 @@ describe('Confidential merge request project form group component', () => {
it
(
'
sets selected project as first fork
'
,
()
=>
{
factory
();
return
localVue
.
nextTick
(()
=>
{
return
vm
.
vm
.
$
nextTick
(()
=>
{
expect
(
vm
.
vm
.
selectedProject
).
toEqual
({
id
:
1
,
name
:
'
root / gitlab-ce
'
,
...
...
@@ -70,7 +68,7 @@ describe('Confidential merge request project form group component', () => {
it
(
'
renders empty state when response is empty
'
,
()
=>
{
factory
([]);
return
localVue
.
nextTick
(()
=>
{
return
vm
.
vm
.
$
nextTick
(()
=>
{
expect
(
vm
.
element
).
toMatchSnapshot
();
});
});
...
...
spec/frontend/contributors/component/contributors_spec.js
View file @
0461c4ef
import
Vue
from
'
vue
'
;
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
{
createStore
}
from
'
~/contributors/stores
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
ContributorsCharts
from
'
~/contributors/components/contributors.vue
'
;
const
localVue
=
createLocalVue
();
let
wrapper
;
let
mock
;
let
store
;
...
...
@@ -52,7 +51,7 @@ describe('Contributors charts', () => {
it
(
'
should display loader whiled loading data
'
,
()
=>
{
wrapper
.
vm
.
$store
.
state
.
loading
=
true
;
return
localVue
.
nextTick
(()
=>
{
return
wrapper
.
vm
.
$
nextTick
(()
=>
{
expect
(
wrapper
.
find
(
'
.contributors-loader
'
).
exists
()).
toBe
(
true
);
});
});
...
...
@@ -60,7 +59,7 @@ describe('Contributors charts', () => {
it
(
'
should render charts when loading completed and there is chart data
'
,
()
=>
{
wrapper
.
vm
.
$store
.
state
.
loading
=
false
;
wrapper
.
vm
.
$store
.
state
.
chartData
=
chartData
;
return
localVue
.
nextTick
(()
=>
{
return
wrapper
.
vm
.
$
nextTick
(()
=>
{
expect
(
wrapper
.
find
(
'
.contributors-loader
'
).
exists
()).
toBe
(
false
);
expect
(
wrapper
.
find
(
'
.contributors-charts
'
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
element
).
toMatchSnapshot
();
...
...
spec/frontend/ide/components/ide_status_list_spec.js
View file @
0461c4ef
...
...
@@ -25,7 +25,7 @@ describe('ide/components/ide_status_list', () => {
},
});
wrapper
=
shallowMount
(
localVue
.
extend
(
IdeStatusList
)
,
{
wrapper
=
shallowMount
(
IdeStatusList
,
{
localVue
,
sync
:
false
,
store
,
...
...
spec/frontend/issuables_list/components/issuables_list_app_spec.js
View file @
0461c4ef
import
axios
from
'
axios
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlEmptyState
,
GlPagination
,
GlSkeletonLoading
}
from
'
@gitlab/ui
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
{
TEST_HOST
}
from
'
helpers/test_constants
'
;
...
...
@@ -18,8 +18,6 @@ const TEST_ENDPOINT = '/issues';
const
TEST_CREATE_ISSUES_PATH
=
'
/createIssue
'
;
const
TEST_EMPTY_SVG_PATH
=
'
/emptySvg
'
;
const
localVue
=
createLocalVue
();
const
MOCK_ISSUES
=
Array
(
PAGE_SIZE_MANUAL
)
.
fill
(
0
)
.
map
((
_
,
i
)
=>
({
...
...
@@ -40,14 +38,13 @@ describe('Issuables list component', () => {
};
const
factory
=
(
props
=
{
sortKey
:
'
priority
'
})
=>
{
wrapper
=
shallowMount
(
localVue
.
extend
(
IssuablesListApp
)
,
{
wrapper
=
shallowMount
(
IssuablesListApp
,
{
propsData
:
{
endpoint
:
TEST_ENDPOINT
,
createIssuePath
:
TEST_CREATE_ISSUES_PATH
,
emptySvgPath
:
TEST_EMPTY_SVG_PATH
,
...
props
,
},
localVue
,
sync
:
false
,
attachToDocument
:
true
,
});
...
...
spec/frontend/issue_show/components/pinned_links_spec.js
View file @
0461c4ef
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlLink
}
from
'
@gitlab/ui
'
;
import
PinnedLinks
from
'
~/issue_show/components/pinned_links.vue
'
;
const
localVue
=
createLocalVue
();
const
plainZoomUrl
=
'
https://zoom.us/j/123456789
'
;
describe
(
'
PinnedLinks
'
,
()
=>
{
...
...
@@ -19,8 +17,7 @@ describe('PinnedLinks', () => {
};
const
createComponent
=
props
=>
{
wrapper
=
shallowMount
(
localVue
.
extend
(
PinnedLinks
),
{
localVue
,
wrapper
=
shallowMount
(
PinnedLinks
,
{
sync
:
false
,
propsData
:
{
zoomMeetingUrl
:
null
,
...
...
spec/frontend/operation_settings/components/external_dashboard_spec.js
View file @
0461c4ef
import
{
mount
,
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
mount
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlButton
,
GlLink
,
GlFormGroup
,
GlFormInput
}
from
'
@gitlab/ui
'
;
import
{
TEST_HOST
}
from
'
helpers/test_constants
'
;
import
ExternalDashboard
from
'
~/operation_settings/components/external_dashboard.vue
'
;
...
...
@@ -15,12 +15,10 @@ describe('operation settings external dashboard component', () => {
const
operationsSettingsEndpoint
=
`
${
TEST_HOST
}
/mock/ops/settings/endpoint`
;
const
externalDashboardUrl
=
`http://mock-external-domain.com/external/dashboard/url`
;
const
externalDashboardHelpPagePath
=
`
${
TEST_HOST
}
/help/page/path`
;
const
localVue
=
createLocalVue
();
const
mountComponent
=
(
shallow
=
true
)
=>
{
const
config
=
[
ExternalDashboard
,
{
localVue
,
store
:
store
({
operationsSettingsEndpoint
,
externalDashboardUrl
,
...
...
spec/frontend/releases/list/components/evidence_block_spec.js
View file @
0461c4ef
import
{
mount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
{
GlLink
}
from
'
@gitlab/ui
'
;
import
{
truncateSha
}
from
'
~/lib/utils/text_utility
'
;
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
...
...
@@ -10,10 +10,7 @@ describe('Evidence Block', () => {
let
wrapper
;
const
factory
=
(
options
=
{})
=>
{
const
localVue
=
createLocalVue
();
wrapper
=
mount
(
localVue
.
extend
(
EvidenceBlock
),
{
localVue
,
wrapper
=
mount
(
EvidenceBlock
,
{
...
options
,
});
};
...
...
spec/frontend/serverless/components/environment_row_spec.js
View file @
0461c4ef
import
{
createLocalVue
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
environmentRowComponent
from
'
~/serverless/components/environment_row.vue
'
;
import
{
mockServerlessFunctions
,
mockServerlessFunctionsDiffEnv
}
from
'
../mock_data
'
;
import
{
translate
}
from
'
~/serverless/utils
'
;
const
createComponent
=
(
localVue
,
env
,
envName
)
=>
shallowMount
(
environmentRowComponent
,
{
localVue
,
propsData
:
{
env
,
envName
},
sync
:
false
}).
vm
;
const
createComponent
=
(
env
,
envName
)
=>
shallowMount
(
environmentRowComponent
,
{
propsData
:
{
env
,
envName
},
sync
:
false
}).
vm
;
describe
(
'
environment row component
'
,
()
=>
{
describe
(
'
default global cluster case
'
,
()
=>
{
let
localVue
;
let
vm
;
beforeEach
(()
=>
{
localVue
=
createLocalVue
();
vm
=
createComponent
(
localVue
,
translate
(
mockServerlessFunctions
.
functions
)[
'
*
'
],
'
*
'
);
vm
=
createComponent
(
translate
(
mockServerlessFunctions
.
functions
)[
'
*
'
],
'
*
'
);
});
afterEach
(()
=>
vm
.
$destroy
());
...
...
@@ -44,15 +42,9 @@ describe('environment row component', () => {
describe
(
'
default named cluster case
'
,
()
=>
{
let
vm
;
let
localVue
;
beforeEach
(()
=>
{
localVue
=
createLocalVue
();
vm
=
createComponent
(
localVue
,
translate
(
mockServerlessFunctionsDiffEnv
.
functions
).
test
,
'
test
'
,
);
vm
=
createComponent
(
translate
(
mockServerlessFunctionsDiffEnv
.
functions
).
test
,
'
test
'
);
});
afterEach
(()
=>
vm
.
$destroy
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment