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
50db70aa
Commit
50db70aa
authored
Jul 05, 2021
by
Ezekiel Kigbo
Committed by
David O'Regan
Jul 05, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moves the VSA filter EE to CE[RUN-AS-IF-FOSS]
parent
e161f0f1
Changes
38
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
38 changed files
with
161 additions
and
178 deletions
+161
-178
app/assets/javascripts/analytics/shared/components/daterange.vue
...ets/javascripts/analytics/shared/components/daterange.vue
+0
-0
app/assets/javascripts/analytics/shared/components/projects_dropdown_filter.vue
.../analytics/shared/components/projects_dropdown_filter.vue
+3
-3
app/assets/javascripts/analytics/shared/constants.js
app/assets/javascripts/analytics/shared/constants.js
+3
-0
app/assets/javascripts/analytics/shared/graphql/projects.query.graphql
...vascripts/analytics/shared/graphql/projects.query.graphql
+0
-0
app/assets/javascripts/analytics/shared/utils.js
app/assets/javascripts/analytics/shared/utils.js
+4
-0
app/assets/javascripts/cycle_analytics/components/filter_bar.vue
...ets/javascripts/cycle_analytics/components/filter_bar.vue
+0
-0
app/assets/javascripts/cycle_analytics/components/value_stream_filters.vue
...ripts/cycle_analytics/components/value_stream_filters.vue
+3
-4
app/assets/javascripts/cycle_analytics/constants.js
app/assets/javascripts/cycle_analytics/constants.js
+1
-0
app/assets/javascripts/cycle_analytics/store/actions.js
app/assets/javascripts/cycle_analytics/store/actions.js
+2
-0
app/assets/javascripts/cycle_analytics/store/index.js
app/assets/javascripts/cycle_analytics/store/index.js
+2
-0
ee/app/assets/javascripts/analytics/cycle_analytics/components/base.vue
...javascripts/analytics/cycle_analytics/components/base.vue
+1
-1
ee/app/assets/javascripts/analytics/cycle_analytics/constants.js
...assets/javascripts/analytics/cycle_analytics/constants.js
+0
-4
ee/app/assets/javascripts/analytics/merge_request_analytics/components/app.vue
...ipts/analytics/merge_request_analytics/components/app.vue
+1
-1
ee/app/assets/javascripts/analytics/productivity_analytics/components/filter_dropdowns.vue
...cs/productivity_analytics/components/filter_dropdowns.vue
+1
-1
ee/app/assets/javascripts/analytics/productivity_analytics/index.js
...ets/javascripts/analytics/productivity_analytics/index.js
+1
-1
ee/app/assets/javascripts/analytics/shared/components/groups_dropdown_filter.vue
...ts/analytics/shared/components/groups_dropdown_filter.vue
+1
-1
ee/app/assets/javascripts/analytics/shared/constants.js
ee/app/assets/javascripts/analytics/shared/constants.js
+0
-4
ee/app/assets/javascripts/analytics/shared/utils.js
ee/app/assets/javascripts/analytics/shared/utils.js
+0
-5
ee/spec/frontend/analytics/cycle_analytics/components/base_spec.js
...rontend/analytics/cycle_analytics/components/base_spec.js
+50
-48
ee/spec/frontend/analytics/cycle_analytics/components/metrics_spec.js
...tend/analytics/cycle_analytics/components/metrics_spec.js
+2
-1
ee/spec/frontend/analytics/cycle_analytics/mock_data.js
ee/spec/frontend/analytics/cycle_analytics/mock_data.js
+8
-32
ee/spec/frontend/analytics/cycle_analytics/store/actions_spec.js
.../frontend/analytics/cycle_analytics/store/actions_spec.js
+1
-3
ee/spec/frontend/analytics/cycle_analytics/store/getters_spec.js
.../frontend/analytics/cycle_analytics/store/getters_spec.js
+1
-3
ee/spec/frontend/analytics/cycle_analytics/store/modules/duration_chart/actions_spec.js
...le_analytics/store/modules/duration_chart/actions_spec.js
+1
-3
ee/spec/frontend/analytics/cycle_analytics/store/modules/duration_chart/getters_spec.js
...le_analytics/store/modules/duration_chart/getters_spec.js
+2
-6
ee/spec/frontend/analytics/cycle_analytics/store/modules/type_of_work/actions_spec.js
...ycle_analytics/store/modules/type_of_work/actions_spec.js
+2
-7
ee/spec/frontend/analytics/cycle_analytics/store/modules/type_of_work/getters_spec.js
...ycle_analytics/store/modules/type_of_work/getters_spec.js
+2
-6
ee/spec/frontend/analytics/cycle_analytics/store/mutations_spec.js
...rontend/analytics/cycle_analytics/store/mutations_spec.js
+1
-4
ee/spec/frontend/analytics/cycle_analytics/utils_spec.js
ee/spec/frontend/analytics/cycle_analytics/utils_spec.js
+1
-3
ee/spec/frontend/analytics/merge_request_analytics/components/app_spec.js
.../analytics/merge_request_analytics/components/app_spec.js
+1
-1
ee/spec/frontend/analytics/productivity_analytics/components/filter_dropdowns_spec.js
...roductivity_analytics/components/filter_dropdowns_spec.js
+1
-1
ee/spec/frontend/analytics/shared/utils_spec.js
ee/spec/frontend/analytics/shared/utils_spec.js
+0
-24
spec/frontend/analytics/shared/components/daterange_spec.js
spec/frontend/analytics/shared/components/daterange_spec.js
+1
-1
spec/frontend/analytics/shared/components/projects_dropdown_filter_spec.js
...lytics/shared/components/projects_dropdown_filter_spec.js
+2
-2
spec/frontend/analytics/shared/utils_spec.js
spec/frontend/analytics/shared/utils_spec.js
+24
-0
spec/frontend/cycle_analytics/filter_bar_spec.js
spec/frontend/cycle_analytics/filter_bar_spec.js
+2
-2
spec/frontend/cycle_analytics/mock_data.js
spec/frontend/cycle_analytics/mock_data.js
+31
-1
spec/frontend/cycle_analytics/value_stream_filters_spec.js
spec/frontend/cycle_analytics/value_stream_filters_spec.js
+5
-5
No files found.
ee/
app/assets/javascripts/analytics/shared/components/daterange.vue
→
app/assets/javascripts/analytics/shared/components/daterange.vue
View file @
50db70aa
File moved
ee/
app/assets/javascripts/analytics/shared/components/projects_dropdown_filter.vue
→
app/assets/javascripts/analytics/shared/components/projects_dropdown_filter.vue
View file @
50db70aa
...
@@ -9,11 +9,11 @@ import {
...
@@ -9,11 +9,11 @@ import {
GlSearchBoxByType
,
GlSearchBoxByType
,
}
from
'
@gitlab/ui
'
;
}
from
'
@gitlab/ui
'
;
import
{
debounce
}
from
'
lodash
'
;
import
{
debounce
}
from
'
lodash
'
;
import
{
filterBySearchTerm
}
from
'
~/analytics/shared/utils
'
;
import
{
getIdFromGraphQLId
}
from
'
~/graphql_shared/utils
'
;
import
{
getIdFromGraphQLId
}
from
'
~/graphql_shared/utils
'
;
import
{
DEFAULT_DEBOUNCE_AND_THROTTLE_MS
}
from
'
~/lib/utils/constants
'
;
import
{
n__
,
s__
,
__
}
from
'
~/locale
'
;
import
{
n__
,
s__
,
__
}
from
'
~/locale
'
;
import
{
DATA_REFETCH_DELAY
}
from
'
../constants
'
;
import
getProjects
from
'
../graphql/projects.query.graphql
'
;
import
getProjects
from
'
../graphql/projects.query.graphql
'
;
import
{
filterBySearchTerm
}
from
'
../utils
'
;
export
default
{
export
default
{
name
:
'
ProjectsDropdownFilter
'
,
name
:
'
ProjectsDropdownFilter
'
,
...
@@ -106,7 +106,7 @@ export default {
...
@@ -106,7 +106,7 @@ export default {
methods
:
{
methods
:
{
search
:
debounce
(
function
debouncedSearch
()
{
search
:
debounce
(
function
debouncedSearch
()
{
this
.
fetchData
();
this
.
fetchData
();
},
D
ATA_REFETCH_DELAY
),
},
D
EFAULT_DEBOUNCE_AND_THROTTLE_MS
),
getSelectedProjects
(
selectedProject
,
isMarking
)
{
getSelectedProjects
(
selectedProject
,
isMarking
)
{
return
isMarking
return
isMarking
?
this
.
selectedProjects
.
concat
([
selectedProject
])
?
this
.
selectedProjects
.
concat
([
selectedProject
])
...
...
app/assets/javascripts/analytics/shared/constants.js
0 → 100644
View file @
50db70aa
export
const
DATE_RANGE_LIMIT
=
180
;
export
const
OFFSET_DATE_BY_ONE
=
1
;
export
const
PROJECTS_PER_PAGE
=
50
;
ee/
app/assets/javascripts/analytics/shared/graphql/projects.query.graphql
→
app/assets/javascripts/analytics/shared/graphql/projects.query.graphql
View file @
50db70aa
File moved
app/assets/javascripts/analytics/shared/utils.js
0 → 100644
View file @
50db70aa
export
const
filterBySearchTerm
=
(
data
=
[],
searchTerm
=
''
,
filterByKey
=
'
name
'
)
=>
{
if
(
!
searchTerm
?.
length
)
return
data
;
return
data
.
filter
((
item
)
=>
item
[
filterByKey
].
toLowerCase
().
includes
(
searchTerm
.
toLowerCase
()));
};
ee/app/assets/javascripts/analytic
s/cycle_analytics/components/filter_bar.vue
→
app/assets/javascript
s/cycle_analytics/components/filter_bar.vue
View file @
50db70aa
File moved
ee/app/assets/javascripts/analytic
s/cycle_analytics/components/value_stream_filters.vue
→
app/assets/javascript
s/cycle_analytics/components/value_stream_filters.vue
View file @
50db70aa
<
script
>
<
script
>
import
DateRange
from
'
../../shared/components/daterange.vue
'
;
import
DateRange
from
'
~/analytics/shared/components/daterange.vue
'
;
import
ProjectsDropdownFilter
from
'
../../shared/components/projects_dropdown_filter.vue
'
;
import
ProjectsDropdownFilter
from
'
~/analytics/shared/components/projects_dropdown_filter.vue
'
;
import
{
DATE_RANGE_LIMIT
}
from
'
../../shared/constants
'
;
import
{
DATE_RANGE_LIMIT
,
PROJECTS_PER_PAGE
}
from
'
~/analytics/shared/constants
'
;
import
{
PROJECTS_PER_PAGE
}
from
'
../constants
'
;
import
FilterBar
from
'
./filter_bar.vue
'
;
import
FilterBar
from
'
./filter_bar.vue
'
;
export
default
{
export
default
{
...
...
app/assets/javascripts/cycle_analytics/constants.js
View file @
50db70aa
export
const
DEFAULT_DAYS_IN_PAST
=
30
;
export
const
DEFAULT_DAYS_TO_DISPLAY
=
30
;
export
const
DEFAULT_DAYS_TO_DISPLAY
=
30
;
export
const
OVERVIEW_STAGE_ID
=
'
overview
'
;
export
const
OVERVIEW_STAGE_ID
=
'
overview
'
;
...
...
app/assets/javascripts/cycle_analytics/store/actions.js
View file @
50db70aa
...
@@ -92,6 +92,8 @@ const refetchData = (dispatch, commit) => {
...
@@ -92,6 +92,8 @@ const refetchData = (dispatch, commit) => {
.
finally
(()
=>
commit
(
types
.
SET_LOADING
,
false
));
.
finally
(()
=>
commit
(
types
.
SET_LOADING
,
false
));
};
};
export
const
setFilters
=
({
dispatch
,
commit
})
=>
refetchData
(
dispatch
,
commit
);
export
const
setDateRange
=
({
dispatch
,
commit
},
{
startDate
=
DEFAULT_DAYS_TO_DISPLAY
})
=>
{
export
const
setDateRange
=
({
dispatch
,
commit
},
{
startDate
=
DEFAULT_DAYS_TO_DISPLAY
})
=>
{
commit
(
types
.
SET_DATE_RANGE
,
{
startDate
});
commit
(
types
.
SET_DATE_RANGE
,
{
startDate
});
return
refetchData
(
dispatch
,
commit
);
return
refetchData
(
dispatch
,
commit
);
...
...
app/assets/javascripts/cycle_analytics/store/index.js
View file @
50db70aa
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
Vuex
from
'
vuex
'
;
import
Vuex
from
'
vuex
'
;
import
filters
from
'
~/vue_shared/components/filtered_search_bar/store/modules/filters
'
;
import
*
as
actions
from
'
./actions
'
;
import
*
as
actions
from
'
./actions
'
;
import
*
as
getters
from
'
./getters
'
;
import
*
as
getters
from
'
./getters
'
;
import
mutations
from
'
./mutations
'
;
import
mutations
from
'
./mutations
'
;
...
@@ -20,4 +21,5 @@ export default () =>
...
@@ -20,4 +21,5 @@ export default () =>
getters
,
getters
,
mutations
,
mutations
,
state
,
state
,
modules
:
{
filters
},
});
});
ee/app/assets/javascripts/analytics/cycle_analytics/components/base.vue
View file @
50db70aa
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
import
{
GlEmptyState
}
from
'
@gitlab/ui
'
;
import
{
GlEmptyState
}
from
'
@gitlab/ui
'
;
import
{
mapActions
,
mapState
,
mapGetters
}
from
'
vuex
'
;
import
{
mapActions
,
mapState
,
mapGetters
}
from
'
vuex
'
;
import
PathNavigation
from
'
~/cycle_analytics/components/path_navigation.vue
'
;
import
PathNavigation
from
'
~/cycle_analytics/components/path_navigation.vue
'
;
import
ValueStreamFilters
from
'
~/cycle_analytics/components/value_stream_filters.vue
'
;
import
{
OVERVIEW_STAGE_ID
}
from
'
~/cycle_analytics/constants
'
;
import
{
OVERVIEW_STAGE_ID
}
from
'
~/cycle_analytics/constants
'
;
import
UrlSync
from
'
~/vue_shared/components/url_sync.vue
'
;
import
UrlSync
from
'
~/vue_shared/components/url_sync.vue
'
;
import
{
toYmd
}
from
'
../../shared/utils
'
;
import
{
toYmd
}
from
'
../../shared/utils
'
;
...
@@ -9,7 +10,6 @@ import DurationChart from './duration_chart.vue';
...
@@ -9,7 +10,6 @@ import DurationChart from './duration_chart.vue';
import
Metrics
from
'
./metrics.vue
'
;
import
Metrics
from
'
./metrics.vue
'
;
import
StageTable
from
'
./stage_table.vue
'
;
import
StageTable
from
'
./stage_table.vue
'
;
import
TypeOfWorkCharts
from
'
./type_of_work_charts.vue
'
;
import
TypeOfWorkCharts
from
'
./type_of_work_charts.vue
'
;
import
ValueStreamFilters
from
'
./value_stream_filters.vue
'
;
import
ValueStreamSelect
from
'
./value_stream_select.vue
'
;
import
ValueStreamSelect
from
'
./value_stream_select.vue
'
;
export
default
{
export
default
{
...
...
ee/app/assets/javascripts/analytics/cycle_analytics/constants.js
View file @
50db70aa
import
{
OVERVIEW_STAGE_ID
}
from
'
~/cycle_analytics/constants
'
;
import
{
OVERVIEW_STAGE_ID
}
from
'
~/cycle_analytics/constants
'
;
import
{
__
,
s__
}
from
'
~/locale
'
;
import
{
__
,
s__
}
from
'
~/locale
'
;
export
const
PROJECTS_PER_PAGE
=
50
;
export
const
DEFAULT_DAYS_IN_PAST
=
30
;
export
const
EVENTS_LIST_ITEM_LIMIT
=
50
;
export
const
EVENTS_LIST_ITEM_LIMIT
=
50
;
export
const
TASKS_BY_TYPE_SUBJECT_ISSUE
=
'
Issue
'
;
export
const
TASKS_BY_TYPE_SUBJECT_ISSUE
=
'
Issue
'
;
...
...
ee/app/assets/javascripts/analytics/merge_request_analytics/components/app.vue
View file @
50db70aa
<
script
>
<
script
>
import
dateFormat
from
'
dateformat
'
;
import
dateFormat
from
'
dateformat
'
;
import
DateRange
from
'
~/analytics/shared/components/daterange.vue
'
;
import
UrlSync
from
'
~/vue_shared/components/url_sync.vue
'
;
import
UrlSync
from
'
~/vue_shared/components/url_sync.vue
'
;
import
DateRange
from
'
../../shared/components/daterange.vue
'
;
import
{
dateFormats
}
from
'
../../shared/constants
'
;
import
{
dateFormats
}
from
'
../../shared/constants
'
;
import
{
DEFAULT_NUMBER_OF_DAYS
}
from
'
../constants
'
;
import
{
DEFAULT_NUMBER_OF_DAYS
}
from
'
../constants
'
;
import
FilterBar
from
'
./filter_bar.vue
'
;
import
FilterBar
from
'
./filter_bar.vue
'
;
...
...
ee/app/assets/javascripts/analytics/productivity_analytics/components/filter_dropdowns.vue
View file @
50db70aa
<
script
>
<
script
>
import
{
mapState
,
mapActions
}
from
'
vuex
'
;
import
{
mapState
,
mapActions
}
from
'
vuex
'
;
import
ProjectsDropdownFilter
from
'
~/analytics/shared/components/projects_dropdown_filter.vue
'
;
import
glFeatureFlagsMixin
from
'
~/vue_shared/mixins/gl_feature_flags_mixin
'
;
import
glFeatureFlagsMixin
from
'
~/vue_shared/mixins/gl_feature_flags_mixin
'
;
import
GroupsDropdownFilter
from
'
../../shared/components/groups_dropdown_filter.vue
'
;
import
GroupsDropdownFilter
from
'
../../shared/components/groups_dropdown_filter.vue
'
;
import
ProjectsDropdownFilter
from
'
../../shared/components/projects_dropdown_filter.vue
'
;
import
{
accessLevelReporter
,
projectsPerPage
}
from
'
../constants
'
;
import
{
accessLevelReporter
,
projectsPerPage
}
from
'
../constants
'
;
export
default
{
export
default
{
...
...
ee/app/assets/javascripts/analytics/productivity_analytics/index.js
View file @
50db70aa
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
{
mapState
,
mapActions
}
from
'
vuex
'
;
import
{
mapState
,
mapActions
}
from
'
vuex
'
;
import
DateRange
from
'
~/analytics/shared/components/daterange.vue
'
;
import
{
getIdFromGraphQLId
}
from
'
~/graphql_shared/utils
'
;
import
{
getIdFromGraphQLId
}
from
'
~/graphql_shared/utils
'
;
import
createDefaultClient
from
'
~/lib/graphql
'
;
import
createDefaultClient
from
'
~/lib/graphql
'
;
import
{
parseBoolean
}
from
'
~/lib/utils/common_utils
'
;
import
{
parseBoolean
}
from
'
~/lib/utils/common_utils
'
;
import
DateRange
from
'
../shared/components/daterange.vue
'
;
import
{
buildGroupFromDataset
,
buildProjectFromDataset
}
from
'
../shared/utils
'
;
import
{
buildGroupFromDataset
,
buildProjectFromDataset
}
from
'
../shared/utils
'
;
import
ProductivityAnalyticsApp
from
'
./components/app.vue
'
;
import
ProductivityAnalyticsApp
from
'
./components/app.vue
'
;
import
FilterDropdowns
from
'
./components/filter_dropdowns.vue
'
;
import
FilterDropdowns
from
'
./components/filter_dropdowns.vue
'
;
...
...
ee/app/assets/javascripts/analytics/shared/components/groups_dropdown_filter.vue
View file @
50db70aa
...
@@ -10,10 +10,10 @@ import {
...
@@ -10,10 +10,10 @@ import {
GlSafeHtmlDirective
as
SafeHtml
,
GlSafeHtmlDirective
as
SafeHtml
,
}
from
'
@gitlab/ui
'
;
}
from
'
@gitlab/ui
'
;
import
{
debounce
}
from
'
lodash
'
;
import
{
debounce
}
from
'
lodash
'
;
import
{
filterBySearchTerm
}
from
'
~/analytics/shared/utils
'
;
import
Api
from
'
~/api
'
;
import
Api
from
'
~/api
'
;
import
{
s__
,
__
}
from
'
~/locale
'
;
import
{
s__
,
__
}
from
'
~/locale
'
;
import
{
DATA_REFETCH_DELAY
}
from
'
../constants
'
;
import
{
DATA_REFETCH_DELAY
}
from
'
../constants
'
;
import
{
filterBySearchTerm
}
from
'
../utils
'
;
export
default
{
export
default
{
name
:
'
GroupsDropdownFilter
'
,
name
:
'
GroupsDropdownFilter
'
,
...
...
ee/app/assets/javascripts/analytics/shared/constants.js
View file @
50db70aa
...
@@ -19,10 +19,6 @@ export const scatterChartLineProps = {
...
@@ -19,10 +19,6 @@ export const scatterChartLineProps = {
},
},
};
};
export
const
DATE_RANGE_LIMIT
=
180
;
export
const
OFFSET_DATE_BY_ONE
=
1
;
export
const
NO_DRAG_CLASS
=
'
no-drag
'
;
export
const
NO_DRAG_CLASS
=
'
no-drag
'
;
export
const
DATA_REFETCH_DELAY
=
DEFAULT_DEBOUNCE_AND_THROTTLE_MS
;
export
const
DATA_REFETCH_DELAY
=
DEFAULT_DEBOUNCE_AND_THROTTLE_MS
;
ee/app/assets/javascripts/analytics/shared/utils.js
View file @
50db70aa
...
@@ -135,8 +135,3 @@ export const buildCycleAnalyticsInitialData = ({
...
@@ -135,8 +135,3 @@ export const buildCycleAnalyticsInitialData = ({
:
[],
:
[],
stage
:
JSON
.
parse
(
stage
),
stage
:
JSON
.
parse
(
stage
),
});
});
export
const
filterBySearchTerm
=
(
data
=
[],
searchTerm
=
''
,
filterByKey
=
'
name
'
)
=>
{
if
(
!
searchTerm
?.
length
)
return
data
;
return
data
.
filter
((
item
)
=>
item
[
filterByKey
].
toLowerCase
().
includes
(
searchTerm
.
toLowerCase
()));
};
ee/spec/frontend/analytics/cycle_analytics/components/base_spec.js
View file @
50db70aa
This diff is collapsed.
Click to expand it.
ee/spec/frontend/analytics/cycle_analytics/components/metrics_spec.js
View file @
50db70aa
...
@@ -3,8 +3,9 @@ import { shallowMount } from '@vue/test-utils';
...
@@ -3,8 +3,9 @@ import { shallowMount } from '@vue/test-utils';
import
{
nextTick
}
from
'
vue
'
;
import
{
nextTick
}
from
'
vue
'
;
import
Metrics
from
'
ee/analytics/cycle_analytics/components/metrics.vue
'
;
import
Metrics
from
'
ee/analytics/cycle_analytics/components/metrics.vue
'
;
import
Api
from
'
ee/api
'
;
import
Api
from
'
ee/api
'
;
import
{
group
}
from
'
jest/cycle_analytics/mock_data
'
;
import
createFlash
from
'
~/flash
'
;
import
createFlash
from
'
~/flash
'
;
import
{
group
,
timeMetricsData
,
recentActivityData
}
from
'
../mock_data
'
;
import
{
timeMetricsData
,
recentActivityData
}
from
'
../mock_data
'
;
jest
.
mock
(
'
~/flash
'
);
jest
.
mock
(
'
~/flash
'
);
...
...
ee/spec/frontend/analytics/cycle_analytics/mock_data.js
View file @
50db70aa
import
{
uniq
}
from
'
lodash
'
;
import
{
uniq
}
from
'
lodash
'
;
import
{
import
{
DEFAULT_DAYS_IN_PAST
,
TASKS_BY_TYPE_SUBJECT_ISSUE
,
TASKS_BY_TYPE_SUBJECT_ISSUE
,
OVERVIEW_STAGE_CONFIG
,
OVERVIEW_STAGE_CONFIG
,
PAGINATION_TYPE
,
PAGINATION_TYPE
,
...
@@ -15,11 +14,16 @@ import {
...
@@ -15,11 +14,16 @@ import {
}
from
'
ee/analytics/cycle_analytics/utils
'
;
}
from
'
ee/analytics/cycle_analytics/utils
'
;
import
{
toYmd
}
from
'
ee/analytics/shared/utils
'
;
import
{
toYmd
}
from
'
ee/analytics/shared/utils
'
;
import
{
getJSONFixture
}
from
'
helpers/fixtures
'
;
import
{
getJSONFixture
}
from
'
helpers/fixtures
'
;
import
{
TEST_HOST
}
from
'
helpers/test_constants
'
;
import
{
import
{
getStageByTitle
,
defaultStages
,
rawStageMedians
}
from
'
jest/cycle_analytics/mock_data
'
;
getStageByTitle
,
defaultStages
,
rawStageMedians
,
createdBefore
,
createdAfter
,
}
from
'
jest/cycle_analytics/mock_data
'
;
import
{
transformStagesForPathNavigation
}
from
'
~/cycle_analytics/utils
'
;
import
{
transformStagesForPathNavigation
}
from
'
~/cycle_analytics/utils
'
;
import
{
convertObjectPropsToCamelCase
}
from
'
~/lib/utils/common_utils
'
;
import
{
convertObjectPropsToCamelCase
}
from
'
~/lib/utils/common_utils
'
;
import
{
getDate
InPast
,
getDate
sInRange
}
from
'
~/lib/utils/datetime_utility
'
;
import
{
getDatesInRange
}
from
'
~/lib/utils/datetime_utility
'
;
const
fixtureEndpoints
=
{
const
fixtureEndpoints
=
{
customizableCycleAnalyticsStagesAndEvents
:
'
analytics/value_stream_analytics/stages.json
'
,
// customizable stages and events endpoint
customizableCycleAnalyticsStagesAndEvents
:
'
analytics/value_stream_analytics/stages.json
'
,
// customizable stages and events endpoint
...
@@ -54,16 +58,6 @@ export const groupLabels = getJSONFixture(fixtureEndpoints.groupLabels).map(
...
@@ -54,16 +58,6 @@ export const groupLabels = getJSONFixture(fixtureEndpoints.groupLabels).map(
convertObjectPropsToCamelCase
,
convertObjectPropsToCamelCase
,
);
);
export
const
group
=
{
id
:
1
,
name
:
'
foo
'
,
path
:
'
foo
'
,
full_path
:
'
foo
'
,
avatar_url
:
`
${
TEST_HOST
}
/images/home/nasa.svg`
,
};
export
const
currentGroup
=
convertObjectPropsToCamelCase
(
group
,
{
deep
:
true
});
export
const
recentActivityData
=
getJSONFixture
(
fixtureEndpoints
.
recentActivityData
);
export
const
recentActivityData
=
getJSONFixture
(
fixtureEndpoints
.
recentActivityData
);
export
const
timeMetricsData
=
getJSONFixture
(
fixtureEndpoints
.
timeMetricsData
);
export
const
timeMetricsData
=
getJSONFixture
(
fixtureEndpoints
.
timeMetricsData
);
...
@@ -158,9 +152,6 @@ export const stageCounts = rawStageMedians.reduce((acc, { id, value }) => {
...
@@ -158,9 +152,6 @@ export const stageCounts = rawStageMedians.reduce((acc, { id, value }) => {
return
{
...
acc
,
[
stageId
]:
value
};
return
{
...
acc
,
[
stageId
]:
value
};
},
{});
},
{});
export
const
createdBefore
=
new
Date
(
2019
,
0
,
14
);
export
const
createdAfter
=
getDateInPast
(
createdBefore
,
DEFAULT_DAYS_IN_PAST
);
export
const
issueEvents
=
deepCamelCase
(
stageFixtures
.
issue
);
export
const
issueEvents
=
deepCamelCase
(
stageFixtures
.
issue
);
export
const
planEvents
=
deepCamelCase
(
stageFixtures
.
plan
);
export
const
planEvents
=
deepCamelCase
(
stageFixtures
.
plan
);
export
const
reviewEvents
=
deepCamelCase
(
stageFixtures
.
review
);
export
const
reviewEvents
=
deepCamelCase
(
stageFixtures
.
review
);
...
@@ -299,21 +290,6 @@ export const rawDurationMedianData = [
...
@@ -299,21 +290,6 @@ export const rawDurationMedianData = [
},
},
];
];
export
const
selectedProjects
=
[
{
id
:
'
gid://gitlab/Project/1
'
,
name
:
'
cool project
'
,
pathWithNamespace
:
'
group/cool-project
'
,
avatarUrl
:
null
,
},
{
id
:
'
gid://gitlab/Project/2
'
,
name
:
'
another cool project
'
,
pathWithNamespace
:
'
group/another-cool-project
'
,
avatarUrl
:
null
,
},
];
export
const
pathNavIssueMetric
=
172800
;
export
const
pathNavIssueMetric
=
172800
;
export
const
initialPaginationQuery
=
{
export
const
initialPaginationQuery
=
{
...
...
ee/spec/frontend/analytics/cycle_analytics/store/actions_spec.js
View file @
50db70aa
...
@@ -5,13 +5,11 @@ import * as actions from 'ee/analytics/cycle_analytics/store/actions';
...
@@ -5,13 +5,11 @@ import * as actions from 'ee/analytics/cycle_analytics/store/actions';
import
*
as
getters
from
'
ee/analytics/cycle_analytics/store/getters
'
;
import
*
as
getters
from
'
ee/analytics/cycle_analytics/store/getters
'
;
import
*
as
types
from
'
ee/analytics/cycle_analytics/store/mutation_types
'
;
import
*
as
types
from
'
ee/analytics/cycle_analytics/store/mutation_types
'
;
import
testAction
from
'
helpers/vuex_action_helper
'
;
import
testAction
from
'
helpers/vuex_action_helper
'
;
import
{
createdAfter
,
createdBefore
,
currentGroup
}
from
'
jest/cycle_analytics/mock_data
'
;
import
createFlash
from
'
~/flash
'
;
import
createFlash
from
'
~/flash
'
;
import
httpStatusCodes
from
'
~/lib/utils/http_status
'
;
import
httpStatusCodes
from
'
~/lib/utils/http_status
'
;
import
{
import
{
currentGroup
,
allowedStages
as
stages
,
allowedStages
as
stages
,
createdAfter
,
createdBefore
,
customizableStagesAndEvents
,
customizableStagesAndEvents
,
endpoints
,
endpoints
,
valueStreams
,
valueStreams
,
...
...
ee/spec/frontend/analytics/cycle_analytics/store/getters_spec.js
View file @
50db70aa
import
*
as
getters
from
'
ee/analytics/cycle_analytics/store/getters
'
;
import
*
as
getters
from
'
ee/analytics/cycle_analytics/store/getters
'
;
import
{
createdAfter
,
createdBefore
,
selectedProjects
}
from
'
jest/cycle_analytics/mock_data
'
;
import
{
import
{
filterMilestones
,
filterMilestones
,
filterUsers
,
filterUsers
,
...
@@ -9,10 +10,7 @@ import {
...
@@ -9,10 +10,7 @@ import {
getFilterValues
,
getFilterValues
,
}
from
'
jest/vue_shared/components/filtered_search_bar/store/modules/filters/test_helper
'
;
}
from
'
jest/vue_shared/components/filtered_search_bar/store/modules/filters/test_helper
'
;
import
{
import
{
createdAfter
,
createdBefore
,
allowedStages
,
allowedStages
,
selectedProjects
,
issueStage
,
issueStage
,
stageMedians
,
stageMedians
,
stageCounts
,
stageCounts
,
...
...
ee/spec/frontend/analytics/cycle_analytics/store/modules/duration_chart/actions_spec.js
View file @
50db70aa
...
@@ -5,13 +5,11 @@ import * as actions from 'ee/analytics/cycle_analytics/store/modules/duration_ch
...
@@ -5,13 +5,11 @@ import * as actions from 'ee/analytics/cycle_analytics/store/modules/duration_ch
import
*
as
getters
from
'
ee/analytics/cycle_analytics/store/modules/duration_chart/getters
'
;
import
*
as
getters
from
'
ee/analytics/cycle_analytics/store/modules/duration_chart/getters
'
;
import
*
as
types
from
'
ee/analytics/cycle_analytics/store/modules/duration_chart/mutation_types
'
;
import
*
as
types
from
'
ee/analytics/cycle_analytics/store/modules/duration_chart/mutation_types
'
;
import
testAction
from
'
helpers/vuex_action_helper
'
;
import
testAction
from
'
helpers/vuex_action_helper
'
;
import
{
createdAfter
,
createdBefore
,
group
}
from
'
jest/cycle_analytics/mock_data
'
;
import
createFlash
from
'
~/flash
'
;
import
createFlash
from
'
~/flash
'
;
import
httpStatusCodes
from
'
~/lib/utils/http_status
'
;
import
httpStatusCodes
from
'
~/lib/utils/http_status
'
;
import
{
import
{
group
,
allowedStages
as
stages
,
allowedStages
as
stages
,
createdAfter
,
createdBefore
,
rawDurationData
,
rawDurationData
,
transformedDurationData
,
transformedDurationData
,
endpoints
,
endpoints
,
...
...
ee/spec/frontend/analytics/cycle_analytics/store/modules/duration_chart/getters_spec.js
View file @
50db70aa
import
*
as
getters
from
'
ee/analytics/cycle_analytics/store/modules/duration_chart/getters
'
;
import
*
as
getters
from
'
ee/analytics/cycle_analytics/store/modules/duration_chart/getters
'
;
import
{
import
{
createdAfter
,
createdBefore
}
from
'
jest/cycle_analytics/mock_data
'
;
createdAfter
,
import
{
transformedDurationData
,
durationChartPlottableData
}
from
'
../../../mock_data
'
;
createdBefore
,
transformedDurationData
,
durationChartPlottableData
,
}
from
'
../../../mock_data
'
;
const
rootState
=
{
const
rootState
=
{
createdAfter
,
createdAfter
,
...
...
ee/spec/frontend/analytics/cycle_analytics/store/modules/type_of_work/actions_spec.js
View file @
50db70aa
...
@@ -9,15 +9,10 @@ import * as actions from 'ee/analytics/cycle_analytics/store/modules/type_of_wor
...
@@ -9,15 +9,10 @@ import * as actions from 'ee/analytics/cycle_analytics/store/modules/type_of_wor
import
*
as
getters
from
'
ee/analytics/cycle_analytics/store/modules/type_of_work/getters
'
;
import
*
as
getters
from
'
ee/analytics/cycle_analytics/store/modules/type_of_work/getters
'
;
import
*
as
types
from
'
ee/analytics/cycle_analytics/store/modules/type_of_work/mutation_types
'
;
import
*
as
types
from
'
ee/analytics/cycle_analytics/store/modules/type_of_work/mutation_types
'
;
import
testAction
from
'
helpers/vuex_action_helper
'
;
import
testAction
from
'
helpers/vuex_action_helper
'
;
import
{
createdAfter
,
createdBefore
}
from
'
jest/cycle_analytics/mock_data
'
;
import
createFlash
from
'
~/flash
'
;
import
createFlash
from
'
~/flash
'
;
import
httpStatusCodes
from
'
~/lib/utils/http_status
'
;
import
httpStatusCodes
from
'
~/lib/utils/http_status
'
;
import
{
import
{
groupLabels
,
endpoints
,
rawTasksByTypeData
}
from
'
../../../mock_data
'
;
groupLabels
,
endpoints
,
createdAfter
,
createdBefore
,
rawTasksByTypeData
,
}
from
'
../../../mock_data
'
;
jest
.
mock
(
'
~/flash
'
);
jest
.
mock
(
'
~/flash
'
);
...
...
ee/spec/frontend/analytics/cycle_analytics/store/modules/type_of_work/getters_spec.js
View file @
50db70aa
import
{
tasksByTypeChartData
}
from
'
ee/analytics/cycle_analytics/store/modules/type_of_work/getters
'
;
import
{
tasksByTypeChartData
}
from
'
ee/analytics/cycle_analytics/store/modules/type_of_work/getters
'
;
import
{
import
{
createdAfter
,
createdBefore
}
from
'
jest/cycle_analytics/mock_data
'
;
rawTasksByTypeData
,
import
{
rawTasksByTypeData
,
transformedTasksByTypeData
}
from
'
../../../mock_data
'
;
transformedTasksByTypeData
,
createdAfter
,
createdBefore
,
}
from
'
../../../mock_data
'
;
describe
(
'
Type of work getters
'
,
()
=>
{
describe
(
'
Type of work getters
'
,
()
=>
{
describe
(
'
tasksByTypeChartData
'
,
()
=>
{
describe
(
'
tasksByTypeChartData
'
,
()
=>
{
...
...
ee/spec/frontend/analytics/cycle_analytics/store/mutations_spec.js
View file @
50db70aa
...
@@ -4,16 +4,13 @@ import {
...
@@ -4,16 +4,13 @@ import {
}
from
'
ee/analytics/cycle_analytics/constants
'
;
}
from
'
ee/analytics/cycle_analytics/constants
'
;
import
*
as
types
from
'
ee/analytics/cycle_analytics/store/mutation_types
'
;
import
*
as
types
from
'
ee/analytics/cycle_analytics/store/mutation_types
'
;
import
mutations
from
'
ee/analytics/cycle_analytics/store/mutations
'
;
import
mutations
from
'
ee/analytics/cycle_analytics/store/mutations
'
;
import
{
createdAfter
,
createdBefore
,
selectedProjects
}
from
'
jest/cycle_analytics/mock_data
'
;
import
{
import
{
issueStage
,
issueStage
,
planStage
,
planStage
,
codeStage
,
codeStage
,
stagingStage
,
stagingStage
,
reviewStage
,
reviewStage
,
createdAfter
,
createdBefore
,
selectedProjects
,
customizableStagesAndEvents
,
customizableStagesAndEvents
,
valueStreams
,
valueStreams
,
rawCustomStageEvents
,
rawCustomStageEvents
,
...
...
ee/spec/frontend/analytics/cycle_analytics/utils_spec.js
View file @
50db70aa
...
@@ -19,7 +19,7 @@ import {
...
@@ -19,7 +19,7 @@ import {
formatMedianValuesWithOverview
,
formatMedianValuesWithOverview
,
}
from
'
ee/analytics/cycle_analytics/utils
'
;
}
from
'
ee/analytics/cycle_analytics/utils
'
;
import
{
toYmd
}
from
'
ee/analytics/shared/utils
'
;
import
{
toYmd
}
from
'
ee/analytics/shared/utils
'
;
import
{
rawStageMedians
}
from
'
jest/cycle_analytics/mock_data
'
;
import
{
createdAfter
,
createdBefore
,
rawStageMedians
}
from
'
jest/cycle_analytics/mock_data
'
;
import
{
OVERVIEW_STAGE_ID
}
from
'
~/cycle_analytics/constants
'
;
import
{
OVERVIEW_STAGE_ID
}
from
'
~/cycle_analytics/constants
'
;
import
{
medianTimeToParsedSeconds
}
from
'
~/cycle_analytics/utils
'
;
import
{
medianTimeToParsedSeconds
}
from
'
~/cycle_analytics/utils
'
;
import
{
getDatesInRange
}
from
'
~/lib/utils/datetime_utility
'
;
import
{
getDatesInRange
}
from
'
~/lib/utils/datetime_utility
'
;
...
@@ -32,8 +32,6 @@ import {
...
@@ -32,8 +32,6 @@ import {
transformedDurationData
,
transformedDurationData
,
flattenedDurationData
,
flattenedDurationData
,
durationChartPlottableData
,
durationChartPlottableData
,
createdAfter
,
createdBefore
,
issueStage
,
issueStage
,
rawCustomStage
,
rawCustomStage
,
rawTasksByTypeData
,
rawTasksByTypeData
,
...
...
ee/spec/frontend/analytics/merge_request_analytics/components/app_spec.js
View file @
50db70aa
...
@@ -3,7 +3,7 @@ import MergeRequestAnalyticsApp from 'ee/analytics/merge_request_analytics/compo
...
@@ -3,7 +3,7 @@ import MergeRequestAnalyticsApp from 'ee/analytics/merge_request_analytics/compo
import
FilterBar
from
'
ee/analytics/merge_request_analytics/components/filter_bar.vue
'
;
import
FilterBar
from
'
ee/analytics/merge_request_analytics/components/filter_bar.vue
'
;
import
ThroughputChart
from
'
ee/analytics/merge_request_analytics/components/throughput_chart.vue
'
;
import
ThroughputChart
from
'
ee/analytics/merge_request_analytics/components/throughput_chart.vue
'
;
import
ThroughputTable
from
'
ee/analytics/merge_request_analytics/components/throughput_table.vue
'
;
import
ThroughputTable
from
'
ee/analytics/merge_request_analytics/components/throughput_table.vue
'
;
import
DateRange
from
'
ee
/analytics/shared/components/daterange.vue
'
;
import
DateRange
from
'
~
/analytics/shared/components/daterange.vue
'
;
import
UrlSync
from
'
~/vue_shared/components/url_sync.vue
'
;
import
UrlSync
from
'
~/vue_shared/components/url_sync.vue
'
;
describe
(
'
MergeRequestAnalyticsApp
'
,
()
=>
{
describe
(
'
MergeRequestAnalyticsApp
'
,
()
=>
{
...
...
ee/spec/frontend/analytics/productivity_analytics/components/filter_dropdowns_spec.js
View file @
50db70aa
...
@@ -3,7 +3,7 @@ import Vuex from 'vuex';
...
@@ -3,7 +3,7 @@ import Vuex from 'vuex';
import
FilterDropdowns
from
'
ee/analytics/productivity_analytics/components/filter_dropdowns.vue
'
;
import
FilterDropdowns
from
'
ee/analytics/productivity_analytics/components/filter_dropdowns.vue
'
;
import
{
getStoreConfig
}
from
'
ee/analytics/productivity_analytics/store
'
;
import
{
getStoreConfig
}
from
'
ee/analytics/productivity_analytics/store
'
;
import
GroupsDropdownFilter
from
'
ee/analytics/shared/components/groups_dropdown_filter.vue
'
;
import
GroupsDropdownFilter
from
'
ee/analytics/shared/components/groups_dropdown_filter.vue
'
;
import
ProjectsDropdownFilter
from
'
ee
/analytics/shared/components/projects_dropdown_filter.vue
'
;
import
ProjectsDropdownFilter
from
'
~
/analytics/shared/components/projects_dropdown_filter.vue
'
;
import
resetStore
from
'
../helpers
'
;
import
resetStore
from
'
../helpers
'
;
const
localVue
=
createLocalVue
();
const
localVue
=
createLocalVue
();
...
...
ee/spec/frontend/analytics/shared/utils_spec.js
View file @
50db70aa
...
@@ -2,7 +2,6 @@ import {
...
@@ -2,7 +2,6 @@ import {
buildGroupFromDataset
,
buildGroupFromDataset
,
buildProjectFromDataset
,
buildProjectFromDataset
,
buildCycleAnalyticsInitialData
,
buildCycleAnalyticsInitialData
,
filterBySearchTerm
,
}
from
'
ee/analytics/shared/utils
'
;
}
from
'
ee/analytics/shared/utils
'
;
const
rawValueStream
=
`{
const
rawValueStream
=
`{
...
@@ -179,27 +178,4 @@ describe('buildCycleAnalyticsInitialData', () => {
...
@@ -179,27 +178,4 @@ describe('buildCycleAnalyticsInitialData', () => {
expect
(
buildCycleAnalyticsInitialData
()).
toMatchObject
({
[
field
]:
null
});
expect
(
buildCycleAnalyticsInitialData
()).
toMatchObject
({
[
field
]:
null
});
});
});
});
});
describe
(
'
filterBySearchTerm
'
,
()
=>
{
const
data
=
[
{
name
:
'
eins
'
,
title
:
'
one
'
},
{
name
:
'
zwei
'
,
title
:
'
two
'
},
{
name
:
'
drei
'
,
title
:
'
three
'
},
];
const
searchTerm
=
'
rei
'
;
it
(
'
filters data by `name` for the provided search term
'
,
()
=>
{
expect
(
filterBySearchTerm
(
data
,
searchTerm
)).
toEqual
([
data
[
2
]]);
});
it
(
'
with no search term returns the data
'
,
()
=>
{
[
''
,
null
].
forEach
((
search
)
=>
{
expect
(
filterBySearchTerm
(
data
,
search
)).
toEqual
(
data
);
});
});
it
(
'
with a key, filters by the provided key
'
,
()
=>
{
expect
(
filterBySearchTerm
(
data
,
'
ne
'
,
'
title
'
)).
toEqual
([
data
[
0
]]);
});
});
});
});
ee/
spec/frontend/analytics/shared/components/daterange_spec.js
→
spec/frontend/analytics/shared/components/daterange_spec.js
View file @
50db70aa
import
{
GlDaterangePicker
}
from
'
@gitlab/ui
'
;
import
{
GlDaterangePicker
}
from
'
@gitlab/ui
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
Daterange
from
'
ee/analytics/shared/components/daterange.vue
'
;
import
{
useFakeDate
}
from
'
helpers/fake_date
'
;
import
{
useFakeDate
}
from
'
helpers/fake_date
'
;
import
{
createMockDirective
,
getBinding
}
from
'
helpers/vue_mock_directive
'
;
import
{
createMockDirective
,
getBinding
}
from
'
helpers/vue_mock_directive
'
;
import
Daterange
from
'
~/analytics/shared/components/daterange.vue
'
;
const
defaultProps
=
{
const
defaultProps
=
{
startDate
:
new
Date
(
2019
,
8
,
1
),
startDate
:
new
Date
(
2019
,
8
,
1
),
...
...
ee/
spec/frontend/analytics/shared/components/projects_dropdown_filter_spec.js
→
spec/frontend/analytics/shared/components/projects_dropdown_filter_spec.js
View file @
50db70aa
import
{
GlDropdown
,
GlDropdownItem
}
from
'
@gitlab/ui
'
;
import
{
GlDropdown
,
GlDropdownItem
}
from
'
@gitlab/ui
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
ProjectsDropdownFilter
from
'
ee/analytics/shared/components/projects_dropdown_filter.vue
'
;
import
getProjects
from
'
ee/analytics/shared/graphql/projects.query.graphql
'
;
import
{
TEST_HOST
}
from
'
helpers/test_constants
'
;
import
{
TEST_HOST
}
from
'
helpers/test_constants
'
;
import
ProjectsDropdownFilter
from
'
~/analytics/shared/components/projects_dropdown_filter.vue
'
;
import
getProjects
from
'
~/analytics/shared/graphql/projects.query.graphql
'
;
const
projects
=
[
const
projects
=
[
{
{
...
...
spec/frontend/analytics/shared/utils_spec.js
0 → 100644
View file @
50db70aa
import
{
filterBySearchTerm
}
from
'
~/analytics/shared/utils
'
;
describe
(
'
filterBySearchTerm
'
,
()
=>
{
const
data
=
[
{
name
:
'
eins
'
,
title
:
'
one
'
},
{
name
:
'
zwei
'
,
title
:
'
two
'
},
{
name
:
'
drei
'
,
title
:
'
three
'
},
];
const
searchTerm
=
'
rei
'
;
it
(
'
filters data by `name` for the provided search term
'
,
()
=>
{
expect
(
filterBySearchTerm
(
data
,
searchTerm
)).
toEqual
([
data
[
2
]]);
});
it
(
'
with no search term returns the data
'
,
()
=>
{
[
''
,
null
].
forEach
((
search
)
=>
{
expect
(
filterBySearchTerm
(
data
,
search
)).
toEqual
(
data
);
});
});
it
(
'
with a key, filters by the provided key
'
,
()
=>
{
expect
(
filterBySearchTerm
(
data
,
'
ne
'
,
'
title
'
)).
toEqual
([
data
[
0
]]);
});
});
ee/spec/frontend/analytics/cycle_analytics/component
s/filter_bar_spec.js
→
spec/frontend/cycle_analytic
s/filter_bar_spec.js
View file @
50db70aa
...
@@ -2,12 +2,12 @@ import { createLocalVue, shallowMount } from '@vue/test-utils';
...
@@ -2,12 +2,12 @@ import { createLocalVue, shallowMount } from '@vue/test-utils';
import
axios
from
'
axios
'
;
import
axios
from
'
axios
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
Vuex
from
'
vuex
'
;
import
Vuex
from
'
vuex
'
;
import
FilterBar
from
'
ee/analytics/cycle_analytics/components/filter_bar.vue
'
;
import
storeConfig
from
'
ee/analytics/cycle_analytics/store
'
;
import
{
import
{
filterMilestones
,
filterMilestones
,
filterLabels
,
filterLabels
,
}
from
'
jest/vue_shared/components/filtered_search_bar/store/modules/filters/mock_data
'
;
}
from
'
jest/vue_shared/components/filtered_search_bar/store/modules/filters/mock_data
'
;
import
FilterBar
from
'
~/cycle_analytics/components/filter_bar.vue
'
;
import
storeConfig
from
'
~/cycle_analytics/store
'
;
import
*
as
commonUtils
from
'
~/lib/utils/common_utils
'
;
import
*
as
commonUtils
from
'
~/lib/utils/common_utils
'
;
import
*
as
urlUtils
from
'
~/lib/utils/url_utility
'
;
import
*
as
urlUtils
from
'
~/lib/utils/url_utility
'
;
import
FilteredSearchBar
from
'
~/vue_shared/components/filtered_search_bar/filtered_search_bar_root.vue
'
;
import
FilteredSearchBar
from
'
~/vue_shared/components/filtered_search_bar/filtered_search_bar_root.vue
'
;
...
...
spec/frontend/cycle_analytics/mock_data.js
View file @
50db70aa
import
{
DEFAULT_VALUE_STREAM
}
from
'
~/cycle_analytics/constants
'
;
import
{
TEST_HOST
}
from
'
helpers/test_constants
'
;
import
{
DEFAULT_VALUE_STREAM
,
DEFAULT_DAYS_IN_PAST
}
from
'
~/cycle_analytics/constants
'
;
import
{
convertObjectPropsToCamelCase
}
from
'
~/lib/utils/common_utils
'
;
import
{
convertObjectPropsToCamelCase
}
from
'
~/lib/utils/common_utils
'
;
import
{
getDateInPast
}
from
'
~/lib/utils/datetime_utility
'
;
export
const
createdBefore
=
new
Date
(
2019
,
0
,
14
);
export
const
createdAfter
=
getDateInPast
(
createdBefore
,
DEFAULT_DAYS_IN_PAST
);
export
const
getStageByTitle
=
(
stages
,
title
)
=>
export
const
getStageByTitle
=
(
stages
,
title
)
=>
stages
.
find
((
stage
)
=>
stage
.
title
&&
stage
.
title
.
toLowerCase
().
trim
()
===
title
)
||
{};
stages
.
find
((
stage
)
=>
stage
.
title
&&
stage
.
title
.
toLowerCase
().
trim
()
===
title
)
||
{};
...
@@ -212,6 +217,31 @@ export const transformedProjectStagePathData = [
...
@@ -212,6 +217,31 @@ export const transformedProjectStagePathData = [
export
const
selectedValueStream
=
DEFAULT_VALUE_STREAM
;
export
const
selectedValueStream
=
DEFAULT_VALUE_STREAM
;
export
const
group
=
{
id
:
1
,
name
:
'
foo
'
,
path
:
'
foo
'
,
full_path
:
'
foo
'
,
avatar_url
:
`
${
TEST_HOST
}
/images/home/nasa.svg`
,
};
export
const
currentGroup
=
convertObjectPropsToCamelCase
(
group
,
{
deep
:
true
});
export
const
selectedProjects
=
[
{
id
:
'
gid://gitlab/Project/1
'
,
name
:
'
cool project
'
,
pathWithNamespace
:
'
group/cool-project
'
,
avatarUrl
:
null
,
},
{
id
:
'
gid://gitlab/Project/2
'
,
name
:
'
another cool project
'
,
pathWithNamespace
:
'
group/another-cool-project
'
,
avatarUrl
:
null
,
},
];
export
const
rawValueStreamStages
=
[
export
const
rawValueStreamStages
=
[
{
{
title
:
'
Issue
'
,
title
:
'
Issue
'
,
...
...
ee/spec/frontend/analytics/cycle_analytics/component
s/value_stream_filters_spec.js
→
spec/frontend/cycle_analytic
s/value_stream_filters_spec.js
View file @
50db70aa
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
FilterBar
from
'
ee/analytics/cycle_analytics/components/filter_bar
.vue
'
;
import
Daterange
from
'
~/analytics/shared/components/daterange
.vue
'
;
import
ValueStreamFilters
from
'
ee/analytics/cycle_analytics/components/value_stream_filters
.vue
'
;
import
ProjectsDropdownFilter
from
'
~/analytics/shared/components/projects_dropdown_filter
.vue
'
;
import
Daterange
from
'
ee/analytics/shared/components/daterange
.vue
'
;
import
FilterBar
from
'
~/cycle_analytics/components/filter_bar
.vue
'
;
import
ProjectsDropdownFilter
from
'
ee/analytics/shared/components/projects_dropdown_filter
.vue
'
;
import
ValueStreamFilters
from
'
~/cycle_analytics/components/value_stream_filters
.vue
'
;
import
{
import
{
createdAfter
as
startDate
,
createdAfter
as
startDate
,
createdBefore
as
endDate
,
createdBefore
as
endDate
,
currentGroup
,
currentGroup
,
selectedProjects
,
selectedProjects
,
}
from
'
.
.
/mock_data
'
;
}
from
'
./mock_data
'
;
function
createComponent
(
props
=
{})
{
function
createComponent
(
props
=
{})
{
return
shallowMount
(
ValueStreamFilters
,
{
return
shallowMount
(
ValueStreamFilters
,
{
...
...
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