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
6e183d50
Commit
6e183d50
authored
Dec 22, 2020
by
Lukas Eipert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run prettier on 29 spec files: 1 of 10
Mandatory not to break master. Automatically created with prettier.
parent
281fda79
Changes
30
Hide whitespace changes
Inline
Side-by-side
Showing
30 changed files
with
160 additions
and
220 deletions
+160
-220
.prettierignore
.prettierignore
+0
-9
ee/spec/frontend/admin/dev_ops_report/components/devops_adoption_table_spec.js
...n/dev_ops_report/components/devops_adoption_table_spec.js
+1
-4
ee/spec/frontend/admin/dev_ops_report/mock_data.js
ee/spec/frontend/admin/dev_ops_report/mock_data.js
+8
-2
ee/spec/frontend/analytics/code_review_analytics/components/merge_request_table_spec.js
...e_review_analytics/components/merge_request_table_spec.js
+2
-8
ee/spec/frontend/analytics/contribution_analytics/components/column_chart_spec.js
...cs/contribution_analytics/components/column_chart_spec.js
+6
-1
ee/spec/frontend/analytics/cycle_analytics/components/base_spec.js
...rontend/analytics/cycle_analytics/components/base_spec.js
+1
-4
ee/spec/frontend/analytics/cycle_analytics/components/custom_stage_form_spec.js
...tics/cycle_analytics/components/custom_stage_form_spec.js
+1
-3
ee/spec/frontend/analytics/cycle_analytics/components/duration_chart_spec.js
...alytics/cycle_analytics/components/duration_chart_spec.js
+1
-4
ee/spec/frontend/analytics/cycle_analytics/components/filter_bar_spec.js
...d/analytics/cycle_analytics/components/filter_bar_spec.js
+8
-2
ee/spec/frontend/analytics/cycle_analytics/components/path_navigation_spec.js
...lytics/cycle_analytics/components/path_navigation_spec.js
+1
-3
ee/spec/frontend/analytics/cycle_analytics/components/stage_dropdown_filter_spec.js
.../cycle_analytics/components/stage_dropdown_filter_spec.js
+1
-4
ee/spec/frontend/analytics/cycle_analytics/components/stage_table_nav_spec.js
...lytics/cycle_analytics/components/stage_table_nav_spec.js
+1
-4
ee/spec/frontend/analytics/cycle_analytics/components/tasks_by_type/tasks_by_type_filters_spec.js
...cs/components/tasks_by_type/tasks_by_type_filters_spec.js
+2
-7
ee/spec/frontend/analytics/cycle_analytics/mock_data.js
ee/spec/frontend/analytics/cycle_analytics/mock_data.js
+9
-2
ee/spec/frontend/analytics/cycle_analytics/store/mutations_spec.js
...rontend/analytics/cycle_analytics/store/mutations_spec.js
+2
-2
ee/spec/frontend/analytics/merge_request_analytics/components/throughput_chart_spec.js
...rge_request_analytics/components/throughput_chart_spec.js
+4
-1
ee/spec/frontend/analytics/merge_request_analytics/components/throughput_table_spec.js
...rge_request_analytics/components/throughput_table_spec.js
+6
-9
ee/spec/frontend/analytics/merge_request_analytics/mock_data.js
...c/frontend/analytics/merge_request_analytics/mock_data.js
+5
-1
ee/spec/frontend/analytics/productivity_analytics/components/app_spec.js
...d/analytics/productivity_analytics/components/app_spec.js
+5
-22
ee/spec/frontend/analytics/productivity_analytics/components/metric_chart_spec.js
...cs/productivity_analytics/components/metric_chart_spec.js
+2
-9
ee/spec/frontend/analytics/productivity_analytics/components/mr_table_row_spec.js
...cs/productivity_analytics/components/mr_table_row_spec.js
+3
-5
ee/spec/frontend/analytics/productivity_analytics/mock_data.js
...ec/frontend/analytics/productivity_analytics/mock_data.js
+61
-61
ee/spec/frontend/analytics/productivity_analytics/store/modules/charts/getters_spec.js
...oductivity_analytics/store/modules/charts/getters_spec.js
+3
-3
ee/spec/frontend/analytics/productivity_analytics/utils_spec.js
...c/frontend/analytics/productivity_analytics/utils_spec.js
+5
-1
ee/spec/frontend/analytics/repository_analytics/components/select_projects_dropdown_spec.js
...ory_analytics/components/select_projects_dropdown_spec.js
+7
-15
ee/spec/frontend/analytics/repository_analytics/components/test_coverage_table_spec.js
...pository_analytics/components/test_coverage_table_spec.js
+2
-10
ee/spec/frontend/analytics/shared/components/daterange_spec.js
...ec/frontend/analytics/shared/components/daterange_spec.js
+1
-5
ee/spec/frontend/analytics/shared/components/groups_dropdown_filter_spec.js
...nalytics/shared/components/groups_dropdown_filter_spec.js
+3
-14
ee/spec/frontend/analytics/shared/components/projects_dropdown_filter_spec.js
...lytics/shared/components/projects_dropdown_filter_spec.js
+1
-3
ee/spec/frontend/api_spec.js
ee/spec/frontend/api_spec.js
+8
-2
No files found.
.prettierignore
View file @
6e183d50
...
...
@@ -11,15 +11,6 @@ doc/api/graphql/reference/gitlab_schema.graphql
*.md
# temporarly ignored in order to migrate to prettier@2 more efficiently and iteratively:
ee/spec/frontend/api_spec.js
ee/spec/frontend/admin/dev_ops_report
ee/spec/frontend/analytics/code_review_analytics/components
ee/spec/frontend/analytics/contribution_analytics/components
ee/spec/frontend/analytics/cycle_analytics
ee/spec/frontend/analytics/merge_request_analytics
ee/spec/frontend/analytics/productivity_analytics
ee/spec/frontend/analytics/repository_analytics/components
ee/spec/frontend/analytics/shared/components
ee/spec/frontend/approvals/components
ee/spec/frontend/audit_events/components
ee/spec/frontend/billings/subscriptions/components
...
...
ee/spec/frontend/admin/dev_ops_report/components/devops_adoption_table_spec.js
View file @
6e183d50
...
...
@@ -34,10 +34,7 @@ describe('DevopsAdoptionTable', () => {
const
findCol
=
testId
=>
findTable
().
find
(
`[data-testid="
${
testId
}
"]`
);
const
findColRowChild
=
(
col
,
row
,
child
)
=>
findTable
()
.
findAll
(
`[data-testid="
${
col
}
"]`
)
.
at
(
row
)
.
find
(
child
);
findTable
().
findAll
(
`[data-testid="
${
col
}
"]`
).
at
(
row
).
find
(
child
);
const
findColSubComponent
=
(
colTestId
,
childComponent
)
=>
findCol
(
colTestId
).
find
(
childComponent
);
...
...
ee/spec/frontend/admin/dev_ops_report/mock_data.js
View file @
6e183d50
export
const
groupData
=
[{
id
:
'
1
'
,
full_name
:
'
Foo
'
},
{
id
:
'
2
'
,
full_name
:
'
Bar
'
}];
export
const
groupData
=
[
{
id
:
'
1
'
,
full_name
:
'
Foo
'
},
{
id
:
'
2
'
,
full_name
:
'
Bar
'
},
];
export
const
pageData
=
{
'
x-next-page
'
:
2
,
...
...
@@ -17,7 +20,10 @@ export const groupNodes = [
},
];
export
const
groupNodeLabelValues
=
[{
label
:
'
Foo
'
,
value
:
'
1
'
},
{
label
:
'
Bar
'
,
value
:
'
2
'
}];
export
const
groupNodeLabelValues
=
[
{
label
:
'
Foo
'
,
value
:
'
1
'
},
{
label
:
'
Bar
'
,
value
:
'
2
'
},
];
export
const
groupIds
=
[
'
1
'
,
'
2
'
];
...
...
ee/spec/frontend/analytics/code_review_analytics/components/merge_request_table_spec.js
View file @
6e183d50
...
...
@@ -41,14 +41,8 @@ describe('MergeRequestTable component', () => {
});
const
findTable
=
()
=>
wrapper
.
find
(
GlTable
);
const
findTableRow
=
index
=>
findTable
()
.
findAll
(
'
tbody tr
'
)
.
at
(
index
);
const
findReviewTimeCol
=
rowIndex
=>
findTableRow
(
rowIndex
)
.
findAll
(
'
td
'
)
.
at
(
1
);
const
findTableRow
=
index
=>
findTable
().
findAll
(
'
tbody tr
'
).
at
(
index
);
const
findReviewTimeCol
=
rowIndex
=>
findTableRow
(
rowIndex
).
findAll
(
'
td
'
).
at
(
1
);
const
updateMergeRequests
=
(
index
,
attrs
)
=>
mockMergeRequests
.
map
((
item
,
idx
)
=>
{
...
...
ee/spec/frontend/analytics/contribution_analytics/components/column_chart_spec.js
View file @
6e183d50
import
{
mount
}
from
'
@vue/test-utils
'
;
import
Component
from
'
ee/analytics/contribution_analytics/components/column_chart.vue
'
;
const
mockChartData
=
[[
'
root
'
,
100
],
[
'
desiree
'
,
30
],
[
'
katlyn
'
,
70
],
[
'
myrtis
'
,
0
]];
const
mockChartData
=
[
[
'
root
'
,
100
],
[
'
desiree
'
,
30
],
[
'
katlyn
'
,
70
],
[
'
myrtis
'
,
0
],
];
describe
(
'
Contribution Analytics Column Chart
'
,
()
=>
{
let
wrapper
;
...
...
ee/spec/frontend/analytics/cycle_analytics/components/base_spec.js
View file @
6e183d50
...
...
@@ -153,10 +153,7 @@ describe('Value Stream Analytics component', () => {
}
const
findStageNavItemAtIndex
=
index
=>
wrapper
.
find
(
StageTableNav
)
.
findAll
(
StageNavItem
)
.
at
(
index
);
wrapper
.
find
(
StageTableNav
).
findAll
(
StageNavItem
).
at
(
index
);
const
findAddStageButton
=
()
=>
wrapper
.
find
(
AddStageButton
);
...
...
ee/spec/frontend/analytics/cycle_analytics/components/custom_stage_form_spec.js
View file @
6e183d50
...
...
@@ -415,9 +415,7 @@ describe('CustomStageForm', () => {
});
it
(
`emits the
${
STAGE_ACTIONS
.
UPDATE
}
action when clicking on a stage to recover`
,
async
()
=>
{
findRecoverStageDropdown
()
.
find
(
GlDropdownItem
)
.
vm
.
$emit
(
'
click
'
);
findRecoverStageDropdown
().
find
(
GlDropdownItem
).
vm
.
$emit
(
'
click
'
);
await
wrapper
.
vm
.
$nextTick
();
expect
(
wrapper
.
emitted
()).
toEqual
({
...
...
ee/spec/frontend/analytics/cycle_analytics/components/duration_chart_spec.js
View file @
6e183d50
...
...
@@ -65,10 +65,7 @@ describe('DurationChart', () => {
const
findLoader
=
_wrapper
=>
_wrapper
.
find
(
ChartSkeletonLoader
);
const
selectStage
=
(
_wrapper
,
index
=
0
)
=>
{
findStageDropdown
(
_wrapper
)
.
findAll
(
GlDropdownItem
)
.
at
(
index
)
.
vm
.
$emit
(
'
click
'
);
findStageDropdown
(
_wrapper
).
findAll
(
GlDropdownItem
).
at
(
index
).
vm
.
$emit
(
'
click
'
);
};
beforeEach
(()
=>
{
...
...
ee/spec/frontend/analytics/cycle_analytics/components/filter_bar_spec.js
View file @
6e183d50
...
...
@@ -186,13 +186,19 @@ describe('Filter bar', () => {
[
'
selectedLabelList
'
,
'
label_name
'
,
[{
value
:
'
Afternix
'
,
operator
:
'
=
'
},
{
value
:
'
Brouceforge
'
,
operator
:
'
=
'
}],
[
{
value
:
'
Afternix
'
,
operator
:
'
=
'
},
{
value
:
'
Brouceforge
'
,
operator
:
'
=
'
},
],
[
'
Afternix
'
,
'
Brouceforge
'
],
],
[
'
selectedAssigneeList
'
,
'
assignee_username
'
,
[{
value
:
'
rootUser
'
,
operator
:
'
=
'
},
{
value
:
'
secondaryUser
'
,
operator
:
'
=
'
}],
[
{
value
:
'
rootUser
'
,
operator
:
'
=
'
},
{
value
:
'
secondaryUser
'
,
operator
:
'
=
'
},
],
[
'
rootUser
'
,
'
secondaryUser
'
],
],
])(
'
with a %s updates the %s url parameter
'
,
(
stateKey
,
paramKey
,
payload
,
result
)
=>
{
...
...
ee/spec/frontend/analytics/cycle_analytics/components/path_navigation_spec.js
View file @
6e183d50
...
...
@@ -22,9 +22,7 @@ describe('PathNavigation', () => {
};
const
clickItemAt
=
index
=>
{
pathNavigationItems
()
.
at
(
index
)
.
trigger
(
'
click
'
);
pathNavigationItems
().
at
(
index
).
trigger
(
'
click
'
);
};
beforeEach
(()
=>
{
...
...
ee/spec/frontend/analytics/cycle_analytics/components/stage_dropdown_filter_spec.js
View file @
6e183d50
...
...
@@ -39,10 +39,7 @@ describe('StageDropdownFilter component', () => {
const
findDropdown
=
()
=>
wrapper
.
find
(
GlDropdown
);
const
selectDropdownItemAtIndex
=
index
=>
findDropdown
()
.
findAll
(
GlDropdownItem
)
.
at
(
index
)
.
vm
.
$emit
(
'
click
'
);
findDropdown
().
findAll
(
GlDropdownItem
).
at
(
index
).
vm
.
$emit
(
'
click
'
);
describe
(
'
on stage click
'
,
()
=>
{
describe
(
'
clicking a selected stage
'
,
()
=>
{
...
...
ee/spec/frontend/analytics/cycle_analytics/components/stage_table_nav_spec.js
View file @
6e183d50
...
...
@@ -27,10 +27,7 @@ describe('StageTableNav', () => {
});
function
selectStage
(
index
)
{
wrapper
.
findAll
(
StageNavItem
)
.
at
(
index
)
.
trigger
(
'
click
'
);
wrapper
.
findAll
(
StageNavItem
).
at
(
index
).
trigger
(
'
click
'
);
}
describe
(
'
when a stage is clicked
'
,
()
=>
{
...
...
ee/spec/frontend/analytics/cycle_analytics/components/tasks_by_type/tasks_by_type_filters_spec.js
View file @
6e183d50
...
...
@@ -23,9 +23,7 @@ const findSelectedSubjectFilters = ctx => findSubjectFilters(ctx).attributes('ch
const
findDropdownLabels
=
ctx
=>
ctx
.
find
(
LabelsSelector
).
findAll
(
GlDropdownItem
);
const
selectLabelAtIndex
=
(
ctx
,
index
)
=>
{
findDropdownLabels
(
ctx
)
.
at
(
index
)
.
trigger
(
'
click
'
);
findDropdownLabels
(
ctx
).
at
(
index
).
trigger
(
'
click
'
);
return
waitForPromises
();
};
...
...
@@ -189,10 +187,7 @@ describe('TasksByTypeFilters', () => {
wrapper
=
createComponent
({
mountFn
:
mount
});
expect
(
wrapper
.
emitted
(
'
updateFilter
'
)).
toBeUndefined
();
findSubjectFilters
(
wrapper
)
.
findAll
(
'
label:not(.active)
'
)
.
at
(
0
)
.
trigger
(
'
click
'
);
findSubjectFilters
(
wrapper
).
findAll
(
'
label:not(.active)
'
).
at
(
0
).
trigger
(
'
click
'
);
return
wrapper
.
vm
.
$nextTick
(()
=>
{
expect
(
wrapper
.
emitted
(
'
updateFilter
'
)).
toBeDefined
();
...
...
ee/spec/frontend/analytics/cycle_analytics/mock_data.js
View file @
6e183d50
...
...
@@ -38,7 +38,10 @@ export const endpoints = {
valueStreamData
:
/analytics
\/
value_stream_analytics
\/
value_streams/
,
};
export
const
valueStreams
=
[{
id
:
1
,
name
:
'
Value stream 1
'
},
{
id
:
2
,
name
:
'
Value stream 2
'
}];
export
const
valueStreams
=
[
{
id
:
1
,
name
:
'
Value stream 1
'
},
{
id
:
2
,
name
:
'
Value stream 2
'
},
];
export
const
groupLabels
=
getJSONFixture
(
fixtureEndpoints
.
groupLabels
).
map
(
convertObjectPropsToCamelCase
,
...
...
@@ -184,7 +187,11 @@ export const transformedStagePathData = transformStagesForPathNavigation({
export
const
tasksByTypeData
=
{
seriesNames
:
[
'
Cool label
'
,
'
Normal label
'
],
data
:
[[
0
,
1
,
2
],
[
5
,
2
,
3
],
[
2
,
4
,
1
]],
data
:
[
[
0
,
1
,
2
],
[
5
,
2
,
3
],
[
2
,
4
,
1
],
],
groupBy
:
[
'
Group 1
'
,
'
Group 2
'
,
'
Group 3
'
],
};
...
...
ee/spec/frontend/analytics/cycle_analytics/store/mutations_spec.js
View file @
6e183d50
...
...
@@ -160,8 +160,8 @@ describe('Value Stream Analytics mutations', () => {
]);
expect
(
stateWithData
.
medians
).
toEqual
({
'
1
'
:
{
value
:
20
,
error
:
null
},
'
2
'
:
{
value
:
10
,
error
:
null
},
1
:
{
value
:
20
,
error
:
null
},
2
:
{
value
:
10
,
error
:
null
},
});
});
});
...
...
ee/spec/frontend/analytics/merge_request_analytics/components/throughput_chart_spec.js
View file @
6e183d50
...
...
@@ -206,7 +206,10 @@ describe('ThroughputChart', () => {
selectedAssignee
:
{
value
:
assigneeUsername
,
operator
},
selectedAuthor
:
{
value
:
authorUsername
,
operator
},
selectedMilestone
:
{
value
:
milestoneTitle
,
operator
},
selectedLabelList
:
[{
value
:
labels
[
0
],
operator
},
{
value
:
labels
[
1
],
operator
}],
selectedLabelList
:
[
{
value
:
labels
[
0
],
operator
},
{
value
:
labels
[
1
],
operator
},
],
});
await
wrapper
.
vm
.
$nextTick
();
expect
(
...
...
ee/spec/frontend/analytics/merge_request_analytics/components/throughput_table_spec.js
View file @
6e183d50
...
...
@@ -78,15 +78,9 @@ describe('ThroughputTable', () => {
const
findPagination
=
()
=>
wrapper
.
find
(
GlPagination
);
const
findPrevious
=
()
=>
findPagination
()
.
findAll
(
'
.page-item
'
)
.
at
(
0
);
const
findPrevious
=
()
=>
findPagination
().
findAll
(
'
.page-item
'
).
at
(
0
);
const
findNext
=
()
=>
findPagination
()
.
findAll
(
'
.page-item
'
)
.
at
(
1
);
const
findNext
=
()
=>
findPagination
().
findAll
(
'
.page-item
'
).
at
(
1
);
afterEach
(()
=>
{
wrapper
.
destroy
();
...
...
@@ -472,7 +466,10 @@ describe('ThroughputTable', () => {
selectedAssignee
:
{
value
:
assigneeUsername
,
operator
},
selectedAuthor
:
{
value
:
authorUsername
,
operator
},
selectedMilestone
:
{
value
:
milestoneTitle
,
operator
},
selectedLabelList
:
[{
value
:
labels
[
0
],
operator
},
{
value
:
labels
[
1
],
operator
}],
selectedLabelList
:
[
{
value
:
labels
[
0
],
operator
},
{
value
:
labels
[
1
],
operator
},
],
});
await
wrapper
.
vm
.
$nextTick
();
expect
(
...
...
ee/spec/frontend/analytics/merge_request_analytics/mock_data.js
View file @
6e183d50
...
...
@@ -23,7 +23,11 @@ export const throughputChartNoData = {
export
const
formattedThroughputChartData
=
[
{
data
:
[[
'
May 2020
'
,
2
],
[
'
Jun 2020
'
,
4
],
[
'
Jul 2020
'
,
3
]],
data
:
[
[
'
May 2020
'
,
2
],
[
'
Jun 2020
'
,
4
],
[
'
Jul 2020
'
,
3
],
],
name
:
THROUGHPUT_CHART_STRINGS
.
Y_AXIS_TITLE
,
},
];
...
...
ee/spec/frontend/analytics/productivity_analytics/components/app_spec.js
View file @
6e183d50
...
...
@@ -218,9 +218,7 @@ describe('ProductivityApp component', () => {
},
};
findMainMetricChart
()
.
find
(
GlColumnChart
)
.
vm
.
$emit
(
'
chartItemClicked
'
,
data
);
findMainMetricChart
().
find
(
GlColumnChart
).
vm
.
$emit
(
'
chartItemClicked
'
,
data
);
});
it
(
'
dispatches updateSelectedItems action
'
,
()
=>
{
...
...
@@ -410,11 +408,7 @@ describe('ProductivityApp component', () => {
});
it
(
'
renders a loading indicator
'
,
()
=>
{
expect
(
findMrTableSection
()
.
find
(
GlLoadingIcon
)
.
exists
(),
).
toBe
(
true
);
expect
(
findMrTableSection
().
find
(
GlLoadingIcon
).
exists
()).
toBe
(
true
);
});
});
...
...
@@ -432,11 +426,7 @@ describe('ProductivityApp component', () => {
});
it
(
'
doesn’t render a "no data" message
'
,
()
=>
{
expect
(
findMrTableSection
()
.
find
(
GlAlert
)
.
exists
(),
).
toBe
(
false
);
expect
(
findMrTableSection
().
find
(
GlAlert
).
exists
()).
toBe
(
false
);
});
it
(
'
should change the column metric
'
,
async
()
=>
{
...
...
@@ -459,10 +449,7 @@ describe('ProductivityApp component', () => {
});
it
(
'
should change the sort field
'
,
()
=>
{
findSortFieldDropdown
()
.
findAll
(
GlDropdownItem
)
.
at
(
0
)
.
vm
.
$emit
(
'
click
'
);
findSortFieldDropdown
().
findAll
(
GlDropdownItem
).
at
(
0
).
vm
.
$emit
(
'
click
'
);
expect
(
tableActionSpies
.
setSortField
).
toHaveBeenCalled
();
});
...
...
@@ -483,11 +470,7 @@ describe('ProductivityApp component', () => {
});
it
(
'
renders a "no data" message
'
,
()
=>
{
expect
(
findMrTableSection
()
.
find
(
GlAlert
)
.
exists
(),
).
toBe
(
true
);
expect
(
findMrTableSection
().
find
(
GlAlert
).
exists
()).
toBe
(
true
);
});
it
(
'
doesn`t render the MR table
'
,
()
=>
{
...
...
ee/spec/frontend/analytics/productivity_analytics/components/metric_chart_spec.js
View file @
6e183d50
...
...
@@ -140,9 +140,7 @@ describe('MetricChart component', () => {
it
(
'
should emit `metricTypeChange` event when dropdown item gets clicked
'
,
()
=>
{
jest
.
spyOn
(
wrapper
.
vm
,
'
$emit
'
);
findMetricDropdownItems
()
.
at
(
0
)
.
vm
.
$emit
(
'
click
'
);
findMetricDropdownItems
().
at
(
0
).
vm
.
$emit
(
'
click
'
);
expect
(
wrapper
.
vm
.
$emit
).
toHaveBeenCalledWith
(
'
metricTypeChange
'
,
'
time_to_merge
'
);
});
...
...
@@ -151,12 +149,7 @@ describe('MetricChart component', () => {
wrapper
.
setProps
({
selectedMetric
:
'
time_to_last_commit
'
});
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
findMetricDropdownItems
()
.
at
(
0
)
.
find
(
GlIcon
)
.
classes
(),
).
toContain
(
'
invisible
'
);
expect
(
findMetricDropdownItems
().
at
(
0
).
find
(
GlIcon
).
classes
()).
toContain
(
'
invisible
'
);
});
});
});
...
...
ee/spec/frontend/analytics/productivity_analytics/components/mr_table_row_spec.js
View file @
6e183d50
...
...
@@ -82,11 +82,9 @@ describe('MergeRequestTableRow component', () => {
});
it
(
'
renders the "Time to merge" metric column with the "days_to_merge" metric
'
,
()
=>
{
expect
(
findMetricColumns
()
.
at
(
0
)
.
props
(
'
value
'
),
).
toBe
(
defaultProps
.
mergeRequest
.
days_to_merge
);
expect
(
findMetricColumns
().
at
(
0
).
props
(
'
value
'
)).
toBe
(
defaultProps
.
mergeRequest
.
days_to_merge
,
);
});
});
});
...
...
ee/spec/frontend/analytics/productivity_analytics/mock_data.js
View file @
6e183d50
...
...
@@ -33,127 +33,127 @@ export const mockMergeRequests = [
];
export
const
mockHistogramData
=
{
'
1
'
:
1
,
'
2
'
:
2
,
'
3
'
:
3
,
'
4
'
:
4
,
'
5
'
:
5
,
'
6
'
:
6
,
'
7
'
:
7
,
'
8
'
:
8
,
'
9
'
:
9
,
'
10
'
:
10
,
'
11
'
:
11
,
'
12
'
:
12
,
'
13
'
:
13
,
'
14
'
:
14
,
'
15
'
:
15
,
'
16
'
:
16
,
'
17
'
:
17
,
'
18
'
:
18
,
'
19
'
:
19
,
'
20
'
:
20
,
'
21
'
:
21
,
'
22
'
:
22
,
'
23
'
:
23
,
'
24
'
:
24
,
'
25
'
:
25
,
'
26
'
:
26
,
'
27
'
:
27
,
'
28
'
:
28
,
'
29
'
:
29
,
'
30
'
:
30
,
'
31
'
:
31
,
'
32
'
:
32
,
'
33
'
:
33
,
'
34
'
:
34
,
'
35
'
:
35
,
'
36
'
:
36
,
'
37
'
:
37
,
'
38
'
:
38
,
'
39
'
:
39
,
'
40
'
:
40
,
'
41
'
:
41
,
1
:
1
,
2
:
2
,
3
:
3
,
4
:
4
,
5
:
5
,
6
:
6
,
7
:
7
,
8
:
8
,
9
:
9
,
10
:
10
,
11
:
11
,
12
:
12
,
13
:
13
,
14
:
14
,
15
:
15
,
16
:
16
,
17
:
17
,
18
:
18
,
19
:
19
,
20
:
20
,
21
:
21
,
22
:
22
,
23
:
23
,
24
:
24
,
25
:
25
,
26
:
26
,
27
:
27
,
28
:
28
,
29
:
29
,
30
:
30
,
31
:
31
,
32
:
32
,
33
:
33
,
34
:
34
,
35
:
35
,
36
:
36
,
37
:
37
,
38
:
38
,
39
:
39
,
40
:
40
,
41
:
41
,
};
export
const
mockScatterplotData
=
{
'
1
'
:
{
1
:
{
metric
:
139
,
merged_at
:
'
2019-08-18T22:00:00.000Z
'
,
},
'
2
'
:
{
2
:
{
metric
:
138
,
merged_at
:
'
2019-08-17T22:00:00.000Z
'
,
},
'
3
'
:
{
3
:
{
metric
:
24
,
merged_at
:
'
2019-08-16T22:00:00.000Z
'
,
},
'
4
'
:
{
4
:
{
metric
:
56
,
merged_at
:
'
2019-08-15T22:00:00.000Z
'
,
},
'
5
'
:
{
5
:
{
metric
:
46
,
merged_at
:
'
2019-08-14T22:00:00.000Z
'
,
},
'
6
'
:
{
6
:
{
metric
:
43
,
merged_at
:
'
2019-08-13T22:00:00.000Z
'
,
},
'
7
'
:
{
7
:
{
metric
:
60
,
merged_at
:
'
2019-08-12T22:00:00.000Z
'
,
},
'
8
'
:
{
8
:
{
metric
:
62
,
merged_at
:
'
2019-08-11T22:00:00.000Z
'
,
},
'
9
'
:
{
9
:
{
metric
:
46
,
merged_at
:
'
2019-08-10T22:00:00.000Z
'
,
},
'
10
'
:
{
10
:
{
metric
:
44
,
merged_at
:
'
2019-08-09T22:00:00.000Z
'
,
},
'
11
'
:
{
11
:
{
metric
:
57
,
merged_at
:
'
2019-08-08T22:00:00.000Z
'
,
},
'
12
'
:
{
12
:
{
metric
:
51
,
merged_at
:
'
2019-08-07T22:00:00.000Z
'
,
},
'
13
'
:
{
13
:
{
metric
:
54
,
merged_at
:
'
2019-08-06T22:00:00.000Z
'
,
},
'
14
'
:
{
14
:
{
metric
:
64
,
merged_at
:
'
2019-08-05T22:00:00.000Z
'
,
},
'
15
'
:
{
15
:
{
metric
:
52
,
merged_at
:
'
2019-08-04T22:00:00.000Z
'
,
},
'
16
'
:
{
16
:
{
metric
:
56
,
merged_at
:
'
2019-08-03T22:00:00.000Z
'
,
},
'
17
'
:
{
17
:
{
metric
:
47
,
merged_at
:
'
2019-08-02T22:00:00.000Z
'
,
},
'
18
'
:
{
18
:
{
metric
:
49
,
merged_at
:
'
2019-08-01T22:00:00.000Z
'
,
},
'
19
'
:
{
19
:
{
metric
:
46
,
merged_at
:
'
2019-07-31T22:00:00.000Z
'
,
},
'
20
'
:
{
20
:
{
metric
:
57
,
merged_at
:
'
2019-07-30T22:00:00.000Z
'
,
},
...
...
ee/spec/frontend/analytics/productivity_analytics/store/modules/charts/getters_spec.js
View file @
6e183d50
...
...
@@ -41,8 +41,8 @@ describe('Productivity analytics chart getters', () => {
const
chartKey
=
chartKeys
.
main
;
state
.
charts
[
chartKey
]
=
{
data
:
{
'
1
'
:
32
,
'
5
'
:
17
,
1
:
32
,
5
:
17
,
},
selected
:
[
'
5
'
],
};
...
...
@@ -221,7 +221,7 @@ describe('Productivity analytics chart getters', () => {
describe
(
`does not exceed threshold of
${
maxColumnChartItemsPerPage
[
chartKey
]}
items`
,
()
=>
{
it
(
'
returns an empty dataZoom property
'
,
()
=>
{
state
.
charts
[
chartKey
].
data
=
{
'
1
'
:
1
,
'
2
'
:
2
,
'
3
'
:
3
};
state
.
charts
[
chartKey
].
data
=
{
1
:
1
,
2
:
2
,
3
:
3
};
expect
(
getters
.
getColumnChartDatazoomOption
(
state
)(
chartKeys
.
main
)).
toEqual
({});
});
...
...
ee/spec/frontend/analytics/productivity_analytics/utils_spec.js
View file @
6e183d50
...
...
@@ -137,7 +137,11 @@ describe('Productivity Analytics utils', () => {
[{
merged_at
:
'
2019-08-06T18:00:00.000Z
'
,
metric
:
80
}],
];
const
result
=
getMedianLineData
(
data
,
startDate
,
endDate
,
daysOffset
);
const
expected
=
[[
'
2019-08-04
'
,
45
],
[
'
2019-08-05
'
,
55
],
[
'
2019-08-06
'
,
65
]];
const
expected
=
[
[
'
2019-08-04
'
,
45
],
[
'
2019-08-05
'
,
55
],
[
'
2019-08-06
'
,
65
],
];
expect
(
result
).
toEqual
(
expected
);
});
});
...
...
ee/spec/frontend/analytics/repository_analytics/components/select_projects_dropdown_spec.js
View file @
6e183d50
...
...
@@ -69,11 +69,9 @@ describe('Select projects dropdown component', () => {
selectAllProjects
();
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
findProjectById
(
initialData
.
groupProjects
[
0
].
id
)
.
find
(
GlIcon
)
.
classes
(),
).
toContain
(
'
gl-visibility-hidden
'
);
expect
(
findProjectById
(
initialData
.
groupProjects
[
0
].
id
).
find
(
GlIcon
).
classes
()).
toContain
(
'
gl-visibility-hidden
'
,
);
});
});
...
...
@@ -104,11 +102,9 @@ describe('Select projects dropdown component', () => {
selectProjectById
(
project
.
id
);
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
findProjectById
(
project
.
id
)
.
find
(
GlIcon
)
.
classes
(),
).
not
.
toContain
(
'
gl-visibility-hidden
'
);
expect
(
findProjectById
(
project
.
id
).
find
(
GlIcon
).
classes
()).
not
.
toContain
(
'
gl-visibility-hidden
'
,
);
});
});
...
...
@@ -116,11 +112,7 @@ describe('Select projects dropdown component', () => {
selectProjectById
(
initialData
.
groupProjects
[
0
].
id
);
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
findSelectAllProjects
()
.
find
(
GlIcon
)
.
classes
(),
).
toContain
(
'
gl-visibility-hidden
'
);
expect
(
findSelectAllProjects
().
find
(
GlIcon
).
classes
()).
toContain
(
'
gl-visibility-hidden
'
);
});
});
...
...
ee/spec/frontend/analytics/repository_analytics/components/test_coverage_table_spec.js
View file @
6e183d50
...
...
@@ -180,16 +180,8 @@ describe('Test coverage table component', () => {
});
expect
(
findTable
().
exists
()).
toBe
(
true
);
expect
(
findTableRows
()
.
at
(
0
)
.
text
(),
).
toContain
(
'
should be first
'
);
expect
(
findTableRows
()
.
at
(
1
)
.
text
(),
).
toContain
(
'
should be last
'
);
expect
(
findTableRows
().
at
(
0
).
text
()).
toContain
(
'
should be first
'
);
expect
(
findTableRows
().
at
(
1
).
text
()).
toContain
(
'
should be last
'
);
});
it
(
'
renders the correct link
'
,
async
()
=>
{
...
...
ee/spec/frontend/analytics/shared/components/daterange_spec.js
View file @
6e183d50
...
...
@@ -75,11 +75,7 @@ describe('Daterange component', () => {
});
it
(
'
displays the correct number of selected days in the indicator
'
,
()
=>
{
expect
(
findDateRangeIndicator
()
.
find
(
'
span
'
)
.
text
(),
).
toBe
(
'
10 days
'
);
expect
(
findDateRangeIndicator
().
find
(
'
span
'
).
text
()).
toBe
(
'
10 days
'
);
});
});
});
...
...
ee/spec/frontend/analytics/shared/components/groups_dropdown_filter_spec.js
View file @
6e183d50
...
...
@@ -58,10 +58,7 @@ describe('GroupsDropdownFilter component', () => {
expect
(
dropdown
.
find
(
'
div.gl-avatar-identicon
'
).
exists
()).
toBe
(
hasIdenticon
);
};
const
selectDropdownAtIndex
=
index
=>
findDropdownAtIndex
(
index
)
.
find
(
'
button
'
)
.
trigger
(
'
click
'
);
const
selectDropdownAtIndex
=
index
=>
findDropdownAtIndex
(
index
).
find
(
'
button
'
).
trigger
(
'
click
'
);
describe
(
'
when passed a defaultGroup as prop
'
,
()
=>
{
beforeEach
(()
=>
{
...
...
@@ -130,16 +127,8 @@ describe('GroupsDropdownFilter component', () => {
selectDropdownAtIndex
(
1
);
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
findDropdownButton
()
.
find
(
'
img.gl-avatar
'
)
.
exists
(),
).
toBe
(
false
);
expect
(
findDropdownButton
()
.
find
(
'
.gl-avatar-identicon
'
)
.
exists
(),
).
toBe
(
true
);
expect
(
findDropdownButton
().
find
(
'
img.gl-avatar
'
).
exists
()).
toBe
(
false
);
expect
(
findDropdownButton
().
find
(
'
.gl-avatar-identicon
'
).
exists
()).
toBe
(
true
);
});
});
});
...
...
ee/spec/frontend/analytics/shared/components/projects_dropdown_filter_spec.js
View file @
6e183d50
...
...
@@ -75,9 +75,7 @@ describe('ProjectsDropdownFilter component', () => {
findDropdownAtIndex
(
index
).
find
(
'
[data-testid="project-full-path"]
'
);
const
selectDropdownItemAtIndex
=
index
=>
findDropdownAtIndex
(
index
)
.
find
(
'
button
'
)
.
trigger
(
'
click
'
);
findDropdownAtIndex
(
index
).
find
(
'
button
'
).
trigger
(
'
click
'
);
describe
(
'
queryParams are applied when fetching data
'
,
()
=>
{
beforeEach
(()
=>
{
...
...
ee/spec/frontend/api_spec.js
View file @
6e183d50
...
...
@@ -292,7 +292,10 @@ describe('Api', () => {
describe
(
'
cycleAnalyticsSummaryData
'
,
()
=>
{
it
(
'
fetches value stream analytics summary data
'
,
done
=>
{
const
response
=
[{
value
:
0
,
title
:
'
New Issues
'
},
{
value
:
0
,
title
:
'
Deploys
'
}];
const
response
=
[
{
value
:
0
,
title
:
'
New Issues
'
},
{
value
:
0
,
title
:
'
Deploys
'
},
];
const
params
=
{
...
defaultParams
};
const
expectedUrl
=
`
${
dummyValueStreamAnalyticsUrlRoot
}
/summary`
;
mock
.
onGet
(
expectedUrl
).
reply
(
httpStatus
.
OK
,
response
);
...
...
@@ -631,7 +634,10 @@ describe('Api', () => {
describe
(
'
getGeoReplicableItems
'
,
()
=>
{
it
(
'
fetches replicableItems based on replicableType
'
,
()
=>
{
apiResponse
=
[{
id
:
1
,
name
:
'
foo
'
},
{
id
:
2
,
name
:
'
bar
'
}];
apiResponse
=
[
{
id
:
1
,
name
:
'
foo
'
},
{
id
:
2
,
name
:
'
bar
'
},
];
mockParams
=
{
page
:
1
};
jest
.
spyOn
(
Api
,
'
buildUrl
'
).
mockReturnValue
(
expectedUrl
);
...
...
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