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
747b33cf
Commit
747b33cf
authored
Aug 28, 2020
by
Illya Klymov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove deprecated methods options from mount
methods option is deprecated in @vue/test-utils 1.x
parent
1a17ee10
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
18 deletions
+35
-18
ee/app/assets/javascripts/analytics/cycle_analytics/components/stage_nav_item.vue
...s/analytics/cycle_analytics/components/stage_nav_item.vue
+3
-0
ee/spec/frontend/analytics/cycle_analytics/components/duration_chart_spec.js
...alytics/cycle_analytics/components/duration_chart_spec.js
+7
-4
ee/spec/frontend/analytics/cycle_analytics/components/stage_nav_item_spec.js
...alytics/cycle_analytics/components/stage_nav_item_spec.js
+9
-4
ee/spec/frontend/analytics/cycle_analytics/components/type_of_work_charts_spec.js
...cs/cycle_analytics/components/type_of_work_charts_spec.js
+7
-4
ee/spec/frontend/analytics/cycle_analytics/components/value_stream_select_spec.js
...cs/cycle_analytics/components/value_stream_select_spec.js
+9
-6
No files found.
ee/app/assets/javascripts/analytics/cycle_analytics/components/stage_nav_item.vue
View file @
747b33cf
...
@@ -60,6 +60,9 @@ export default {
...
@@ -60,6 +60,9 @@ export default {
mounted
()
{
mounted
()
{
this
.
checkIfTitleOverflows
();
this
.
checkIfTitleOverflows
();
},
},
updated
()
{
this
.
checkIfTitleOverflows
();
},
methods
:
{
methods
:
{
handleDropdownAction
(
action
)
{
handleDropdownAction
(
action
)
{
this
.
$emit
(
action
);
this
.
$emit
(
action
);
...
...
ee/spec/frontend/analytics/cycle_analytics/components/duration_chart_spec.js
View file @
747b33cf
import
Vuex
from
'
vuex
'
;
import
Vuex
from
'
vuex
'
;
import
{
shallowMount
,
mount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
,
mount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
GlLoadingIcon
,
GlNewDropdownItem
}
from
'
@gitlab/ui
'
;
import
{
GlLoadingIcon
,
GlNewDropdownItem
}
from
'
@gitlab/ui
'
;
import
durationChartStore
from
'
ee/analytics/cycle_analytics/store/modules/duration_chart
'
;
import
Scatterplot
from
'
ee/analytics/shared/components/scatterplot.vue
'
;
import
Scatterplot
from
'
ee/analytics/shared/components/scatterplot.vue
'
;
import
DurationChart
from
'
ee/analytics/cycle_analytics/components/duration_chart.vue
'
;
import
DurationChart
from
'
ee/analytics/cycle_analytics/components/duration_chart.vue
'
;
import
StageDropdownFilter
from
'
ee/analytics/cycle_analytics/components/stage_dropdown_filter.vue
'
;
import
StageDropdownFilter
from
'
ee/analytics/cycle_analytics/components/stage_dropdown_filter.vue
'
;
...
@@ -19,7 +18,7 @@ const fakeStore = ({ initialGetters, initialState }) =>
...
@@ -19,7 +18,7 @@ const fakeStore = ({ initialGetters, initialState }) =>
new
Vuex
.
Store
({
new
Vuex
.
Store
({
modules
:
{
modules
:
{
durationChart
:
{
durationChart
:
{
...
durationChartStor
e
,
namespaced
:
tru
e
,
getters
:
{
getters
:
{
durationChartPlottableData
:
()
=>
durationData
,
durationChartPlottableData
:
()
=>
durationData
,
...
initialGetters
,
...
initialGetters
,
...
@@ -28,6 +27,7 @@ const fakeStore = ({ initialGetters, initialState }) =>
...
@@ -28,6 +27,7 @@ const fakeStore = ({ initialGetters, initialState }) =>
isLoading
:
false
,
isLoading
:
false
,
...
initialState
,
...
initialState
,
},
},
actions
:
actionSpies
,
},
},
},
},
});
});
...
@@ -46,7 +46,6 @@ function createComponent({
...
@@ -46,7 +46,6 @@ function createComponent({
stages
,
stages
,
...
props
,
...
props
,
},
},
methods
:
actionSpies
,
stubs
:
{
stubs
:
{
GlLoadingIcon
:
true
,
GlLoadingIcon
:
true
,
Scatterplot
:
true
,
Scatterplot
:
true
,
...
@@ -102,7 +101,11 @@ describe('DurationChart', () => {
...
@@ -102,7 +101,11 @@ describe('DurationChart', () => {
});
});
it
(
'
calls the `updateSelectedDurationChartStages` action
'
,
()
=>
{
it
(
'
calls the `updateSelectedDurationChartStages` action
'
,
()
=>
{
expect
(
actionSpies
.
updateSelectedDurationChartStages
).
toHaveBeenCalledWith
(
selectedStages
);
expect
(
actionSpies
.
updateSelectedDurationChartStages
).
toHaveBeenCalledWith
(
expect
.
any
(
Object
),
selectedStages
,
undefined
,
);
});
});
});
});
...
...
ee/spec/frontend/analytics/cycle_analytics/components/stage_nav_item_spec.js
View file @
747b33cf
...
@@ -25,6 +25,10 @@ describe('StageNavItem', () => {
...
@@ -25,6 +25,10 @@ describe('StageNavItem', () => {
const
findStageTitle
=
()
=>
wrapper
.
find
({
ref
:
'
title
'
});
const
findStageTitle
=
()
=>
wrapper
.
find
({
ref
:
'
title
'
});
const
findStageMedian
=
()
=>
wrapper
.
find
({
ref
:
'
median
'
});
const
findStageMedian
=
()
=>
wrapper
.
find
({
ref
:
'
median
'
});
const
findDropdown
=
()
=>
wrapper
.
find
({
ref
:
'
dropdown
'
});
const
findDropdown
=
()
=>
wrapper
.
find
({
ref
:
'
dropdown
'
});
const
setFakeTitleWidth
=
value
=>
Object
.
defineProperty
(
wrapper
.
find
({
ref
:
'
titleSpan
'
}).
element
,
'
scrollWidth
'
,
{
value
,
});
afterEach
(()
=>
{
afterEach
(()
=>
{
wrapper
.
destroy
();
wrapper
.
destroy
();
...
@@ -79,12 +83,13 @@ describe('StageNavItem', () => {
...
@@ -79,12 +83,13 @@ describe('StageNavItem', () => {
data
()
{
data
()
{
return
{
isTitleOverflowing
:
true
};
return
{
isTitleOverflowing
:
true
};
},
},
methods
:
{
// making tbis a noop so it wont toggle 'isTitleOverflowing' on mount
checkIfTitleOverflows
:
()
=>
{},
},
},
},
});
});
// JSDom does not calculate scrollWidth / offsetWidth so we fake it
setFakeTitleWidth
(
1000
);
wrapper
.
vm
.
$forceUpdate
();
return
wrapper
.
vm
.
$nextTick
();
});
});
it
(
'
renders the tooltip
'
,
()
=>
{
it
(
'
renders the tooltip
'
,
()
=>
{
...
...
ee/spec/frontend/analytics/cycle_analytics/components/type_of_work_charts_spec.js
View file @
747b33cf
import
Vuex
from
'
vuex
'
;
import
Vuex
from
'
vuex
'
;
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
tasksByTypeStore
from
'
ee/analytics/cycle_analytics/store/modules/type_of_work
'
;
import
TypeOfWorkCharts
from
'
ee/analytics/cycle_analytics/components/type_of_work_charts.vue
'
;
import
TypeOfWorkCharts
from
'
ee/analytics/cycle_analytics/components/type_of_work_charts.vue
'
;
import
TasksByTypeChart
from
'
ee/analytics/cycle_analytics/components/tasks_by_type/tasks_by_type_chart.vue
'
;
import
TasksByTypeChart
from
'
ee/analytics/cycle_analytics/components/tasks_by_type/tasks_by_type_chart.vue
'
;
import
TasksByTypeFilters
from
'
ee/analytics/cycle_analytics/components/tasks_by_type/tasks_by_type_filters.vue
'
;
import
TasksByTypeFilters
from
'
ee/analytics/cycle_analytics/components/tasks_by_type/tasks_by_type_filters.vue
'
;
...
@@ -22,7 +21,7 @@ const fakeStore = ({ initialGetters, initialState }) =>
...
@@ -22,7 +21,7 @@ const fakeStore = ({ initialGetters, initialState }) =>
new
Vuex
.
Store
({
new
Vuex
.
Store
({
modules
:
{
modules
:
{
typeOfWork
:
{
typeOfWork
:
{
...
tasksByTypeStor
e
,
namespaced
:
tru
e
,
getters
:
{
getters
:
{
tasksByTypeChartData
:
()
=>
tasksByTypeData
,
tasksByTypeChartData
:
()
=>
tasksByTypeData
,
selectedTasksByTypeFilters
:
()
=>
taskByTypeFilters
,
selectedTasksByTypeFilters
:
()
=>
taskByTypeFilters
,
...
@@ -32,6 +31,7 @@ const fakeStore = ({ initialGetters, initialState }) =>
...
@@ -32,6 +31,7 @@ const fakeStore = ({ initialGetters, initialState }) =>
state
:
{
state
:
{
...
initialState
,
...
initialState
,
},
},
actions
:
actionSpies
,
},
},
},
},
});
});
...
@@ -41,7 +41,6 @@ describe('TypeOfWorkCharts', () => {
...
@@ -41,7 +41,6 @@ describe('TypeOfWorkCharts', () => {
return
shallowMount
(
TypeOfWorkCharts
,
{
return
shallowMount
(
TypeOfWorkCharts
,
{
localVue
,
localVue
,
store
:
fakeStore
({
initialGetters
,
initialState
}),
store
:
fakeStore
({
initialGetters
,
initialState
}),
methods
:
actionSpies
,
stubs
:
{
stubs
:
{
TasksByTypeChart
:
true
,
TasksByTypeChart
:
true
,
TasksByTypeFilters
:
true
,
TasksByTypeFilters
:
true
,
...
@@ -111,7 +110,11 @@ describe('TypeOfWorkCharts', () => {
...
@@ -111,7 +110,11 @@ describe('TypeOfWorkCharts', () => {
});
});
it
(
'
calls the setTasksByTypeFilters method
'
,
()
=>
{
it
(
'
calls the setTasksByTypeFilters method
'
,
()
=>
{
expect
(
actionSpies
.
setTasksByTypeFilters
).
toHaveBeenCalledWith
(
payload
);
expect
(
actionSpies
.
setTasksByTypeFilters
).
toHaveBeenCalledWith
(
expect
.
any
(
Object
),
payload
,
undefined
,
);
});
});
});
});
...
...
ee/spec/frontend/analytics/cycle_analytics/components/value_stream_select_spec.js
View file @
747b33cf
...
@@ -25,9 +25,12 @@ describe('ValueStreamSelect', () => {
...
@@ -25,9 +25,12 @@ describe('ValueStreamSelect', () => {
selectedValueStream
:
{},
selectedValueStream
:
{},
...
initialState
,
...
initialState
,
},
},
actions
:
{
createValueStream
:
createValueStreamMock
,
},
});
});
const
createComponent
=
({
data
=
{},
initialState
=
{}
,
methods
=
{}
}
=
{})
=>
const
createComponent
=
({
data
=
{},
initialState
=
{}
}
=
{})
=>
shallowMount
(
ValueStreamSelect
,
{
shallowMount
(
ValueStreamSelect
,
{
localVue
,
localVue
,
store
:
fakeStore
({
initialState
}),
store
:
fakeStore
({
initialState
}),
...
@@ -36,10 +39,6 @@ describe('ValueStreamSelect', () => {
...
@@ -36,10 +39,6 @@ describe('ValueStreamSelect', () => {
...
data
,
...
data
,
};
};
},
},
methods
:
{
createValueStream
:
createValueStreamMock
,
...
methods
,
},
mocks
:
{
mocks
:
{
$toast
:
{
$toast
:
{
show
:
mockToastShow
,
show
:
mockToastShow
,
...
@@ -163,7 +162,11 @@ describe('ValueStreamSelect', () => {
...
@@ -163,7 +162,11 @@ describe('ValueStreamSelect', () => {
});
});
it
(
'
calls the "createValueStream" event when submitted
'
,
()
=>
{
it
(
'
calls the "createValueStream" event when submitted
'
,
()
=>
{
expect
(
createValueStreamMock
).
toHaveBeenCalledWith
({
name
:
streamName
});
expect
(
createValueStreamMock
).
toHaveBeenCalledWith
(
expect
.
any
(
Object
),
{
name
:
streamName
},
undefined
,
);
});
});
it
(
'
clears the name field
'
,
()
=>
{
it
(
'
clears the name field
'
,
()
=>
{
...
...
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