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
20f46eb4
Commit
20f46eb4
authored
Jun 15, 2021
by
jboyson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace find with findAll
parent
257c3b3f
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
34 additions
and
33 deletions
+34
-33
ee/spec/frontend/analytics/code_review_analytics/components/merge_request_table_spec.js
...e_review_analytics/components/merge_request_table_spec.js
+1
-1
ee/spec/frontend/analytics/cycle_analytics/components/create_value_stream_form/custom_stage_fields_spec.js
...ents/create_value_stream_form/custom_stage_fields_spec.js
+4
-4
ee/spec/frontend/analytics/cycle_analytics/components/create_value_stream_form/default_stage_fields_spec.js
...nts/create_value_stream_form/default_stage_fields_spec.js
+6
-9
ee/spec/frontend/analytics/cycle_analytics/components/duration_chart_spec.js
...alytics/cycle_analytics/components/duration_chart_spec.js
+4
-4
ee/spec/frontend/analytics/cycle_analytics/components/filter_bar_spec.js
...d/analytics/cycle_analytics/components/filter_bar_spec.js
+1
-1
ee/spec/frontend/analytics/cycle_analytics/components/labels_selector_spec.js
...lytics/cycle_analytics/components/labels_selector_spec.js
+1
-1
ee/spec/frontend/analytics/cycle_analytics/components/stage_dropdown_filter_spec.js
.../cycle_analytics/components/stage_dropdown_filter_spec.js
+2
-2
ee/spec/frontend/analytics/cycle_analytics/components/stage_table_spec.js
.../analytics/cycle_analytics/components/stage_table_spec.js
+2
-2
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
+5
-4
ee/spec/frontend/analytics/cycle_analytics/components/type_of_work_charts_spec.js
...cs/cycle_analytics/components/type_of_work_charts_spec.js
+3
-3
ee/spec/frontend/analytics/cycle_analytics/components/value_stream_form_spec.js
...tics/cycle_analytics/components/value_stream_form_spec.js
+4
-1
ee/spec/frontend/analytics/cycle_analytics/helpers.js
ee/spec/frontend/analytics/cycle_analytics/helpers.js
+1
-1
No files found.
ee/spec/frontend/analytics/code_review_analytics/components/merge_request_table_spec.js
View file @
20f46eb4
...
...
@@ -40,7 +40,7 @@ describe('MergeRequestTable component', () => {
wrapper
.
destroy
();
});
const
findTable
=
()
=>
wrapper
.
find
(
GlTable
);
const
findTable
=
()
=>
wrapper
.
find
Component
(
GlTable
);
const
findTableRow
=
(
index
)
=>
findTable
().
findAll
(
'
tbody tr
'
).
at
(
index
);
const
findReviewTimeCol
=
(
rowIndex
)
=>
findTableRow
(
rowIndex
).
findAll
(
'
td
'
).
at
(
1
);
...
...
ee/spec/frontend/analytics/cycle_analytics/components/create_value_stream_form/custom_stage_fields_spec.js
View file @
20f46eb4
...
...
@@ -56,8 +56,8 @@ describe('CustomStageFields', () => {
let
wrapper
=
null
;
const
getDropdown
=
(
dropdownEl
)
=>
dropdownEl
.
find
(
GlDropdown
);
const
getLabelSelect
=
(
dropdownEl
)
=>
dropdownEl
.
find
(
LabelsSelector
);
const
getDropdown
=
(
dropdownEl
)
=>
dropdownEl
.
find
Component
(
GlDropdown
);
const
getLabelSelect
=
(
dropdownEl
)
=>
dropdownEl
.
find
Component
(
LabelsSelector
);
const
findName
=
(
index
=
0
)
=>
wrapper
.
findByTestId
(
`custom-stage-name-
${
index
}
`
);
const
findStartEvent
=
(
index
=
0
)
=>
wrapper
.
findByTestId
(
`custom-stage-start-event-
${
index
}
`
);
...
...
@@ -66,12 +66,12 @@ describe('CustomStageFields', () => {
wrapper
.
findByTestId
(
`custom-stage-start-event-label-
${
index
}
`
);
const
findEndEventLabel
=
(
index
=
0
)
=>
wrapper
.
findByTestId
(
`custom-stage-end-event-label-
${
index
}
`
);
const
findNameField
=
()
=>
findName
().
find
(
GlFormInput
);
const
findNameField
=
()
=>
findName
().
find
Component
(
GlFormInput
);
const
findStartEventField
=
()
=>
getDropdown
(
findStartEvent
());
const
findEndEventField
=
()
=>
getDropdown
(
findEndEvent
());
const
findStartEventLabelField
=
()
=>
getLabelSelect
(
findStartEventLabel
());
const
findEndEventLabelField
=
()
=>
getLabelSelect
(
findEndEventLabel
());
const
findStageFieldActions
=
()
=>
wrapper
.
find
(
StageFieldActions
);
const
findStageFieldActions
=
()
=>
wrapper
.
find
Component
(
StageFieldActions
);
beforeEach
(()
=>
{
wrapper
=
createComponent
();
...
...
ee/spec/frontend/analytics/cycle_analytics/components/create_value_stream_form/default_stage_fields_spec.js
View file @
20f46eb4
import
{
GlFormGroup
,
GlFormInput
,
GlFormText
}
from
'
@gitlab/ui
'
;
import
{
GlFormGroup
,
GlFormInput
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
DefaultStageFields
from
'
ee/analytics/cycle_analytics/components/create_value_stream_form/default_stage_fields.vue
'
;
import
StageFieldActions
from
'
ee/analytics/cycle_analytics/components/create_value_stream_form/stage_field_actions.vue
'
;
...
...
@@ -37,13 +37,11 @@ describe('DefaultStageFields', () => {
}
const
findStageFieldName
=
()
=>
wrapper
.
find
(
'
[name="create-value-stream-stage-0"]
'
);
const
findStageFieldNameInput
=
()
=>
findStageFieldName
().
find
(
GlFormInput
);
const
findStageFieldNameInput
=
()
=>
findStageFieldName
().
find
Component
(
GlFormInput
);
const
findStartEvent
=
()
=>
wrapper
.
find
(
'
[data-testid="stage-start-event-0"]
'
);
const
findStartEventInput
=
()
=>
findStartEvent
().
find
(
GlFormText
);
const
findEndEvent
=
()
=>
wrapper
.
find
(
'
[data-testid="stage-end-event-0"]
'
);
const
findEndEventInput
=
()
=>
findEndEvent
().
find
(
GlFormText
);
const
findFormGroup
=
()
=>
wrapper
.
find
(
GlFormGroup
);
const
findFieldActions
=
()
=>
wrapper
.
find
(
StageFieldActions
);
const
findFormGroup
=
()
=>
wrapper
.
findComponent
(
GlFormGroup
);
const
findFieldActions
=
()
=>
wrapper
.
findComponent
(
StageFieldActions
);
beforeEach
(()
=>
{
wrapper
=
createComponent
();
...
...
@@ -64,12 +62,11 @@ describe('DefaultStageFields', () => {
});
it
(
'
renders the field start event
'
,
()
=>
{
expect
(
findStartEventInput
().
exists
()).
toBe
(
true
);
expect
(
findStartEventInput
().
text
()).
toBe
(
ISSUE_CREATED
.
name
);
expect
(
findStartEvent
().
text
()).
toContain
(
ISSUE_CREATED
.
name
);
});
it
(
'
renders the field end event
'
,
()
=>
{
expect
(
findEndEvent
Input
().
text
()).
toBe
(
ISSUE_CLOSED
.
name
);
expect
(
findEndEvent
().
text
()).
toContain
(
ISSUE_CLOSED
.
name
);
});
it
(
'
does not emits any input
'
,
()
=>
{
...
...
ee/spec/frontend/analytics/cycle_analytics/components/duration_chart_spec.js
View file @
20f46eb4
...
...
@@ -60,12 +60,12 @@ describe('DurationChart', () => {
let
wrapper
;
const
findContainer
=
(
_wrapper
)
=>
_wrapper
.
find
(
'
[data-testid="vsa-duration-chart"]
'
);
const
findScatterPlot
=
(
_wrapper
)
=>
_wrapper
.
find
(
Scatterplot
);
const
findStageDropdown
=
(
_wrapper
)
=>
_wrapper
.
find
(
StageDropdownFilter
);
const
findLoader
=
(
_wrapper
)
=>
_wrapper
.
find
(
ChartSkeletonLoader
);
const
findScatterPlot
=
(
_wrapper
)
=>
_wrapper
.
find
Component
(
Scatterplot
);
const
findStageDropdown
=
(
_wrapper
)
=>
_wrapper
.
find
Component
(
StageDropdownFilter
);
const
findLoader
=
(
_wrapper
)
=>
_wrapper
.
find
Component
(
ChartSkeletonLoader
);
const
selectStage
=
(
_wrapper
,
index
=
0
)
=>
{
findStageDropdown
(
_wrapper
).
findAll
(
GlDropdownItem
).
at
(
index
).
vm
.
$emit
(
'
click
'
);
findStageDropdown
(
_wrapper
).
findAll
Components
(
GlDropdownItem
).
at
(
index
).
vm
.
$emit
(
'
click
'
);
};
beforeEach
(()
=>
{
...
...
ee/spec/frontend/analytics/cycle_analytics/components/filter_bar_spec.js
View file @
20f46eb4
...
...
@@ -100,7 +100,7 @@ describe('Filter bar', () => {
const
selectedMilestone
=
[
filterMilestones
[
0
]];
const
selectedLabelList
=
[
filterLabels
[
0
]];
const
findFilteredSearch
=
()
=>
wrapper
.
find
(
FilteredSearchBar
);
const
findFilteredSearch
=
()
=>
wrapper
.
find
Component
(
FilteredSearchBar
);
const
getSearchToken
=
(
type
)
=>
findFilteredSearch
()
.
props
(
'
tokens
'
)
...
...
ee/spec/frontend/analytics/cycle_analytics/components/labels_selector_spec.js
View file @
20f46eb4
...
...
@@ -71,7 +71,7 @@ describe('Value Stream Analytics LabelsSelector', () => {
});
it
(
'
will render with the default option selected
'
,
()
=>
{
const
sectionHeader
=
wrapper
.
find
(
GlDropdownSectionHeader
);
const
sectionHeader
=
wrapper
.
find
Component
(
GlDropdownSectionHeader
);
expect
(
sectionHeader
.
exists
()).
toBe
(
true
);
expect
(
sectionHeader
.
text
()).
toEqual
(
'
Select a label
'
);
...
...
ee/spec/frontend/analytics/cycle_analytics/components/stage_dropdown_filter_spec.js
View file @
20f46eb4
...
...
@@ -37,9 +37,9 @@ describe('StageDropdownFilter component', () => {
createComponent
();
});
const
findDropdown
=
()
=>
wrapper
.
find
(
GlDropdown
);
const
findDropdown
=
()
=>
wrapper
.
find
Component
(
GlDropdown
);
const
selectDropdownItemAtIndex
=
(
index
)
=>
findDropdown
().
findAll
(
GlDropdownItem
).
at
(
index
).
vm
.
$emit
(
'
click
'
);
findDropdown
().
findAll
Components
(
GlDropdownItem
).
at
(
index
).
vm
.
$emit
(
'
click
'
);
describe
(
'
on stage click
'
,
()
=>
{
describe
(
'
clicking a selected stage
'
,
()
=>
{
...
...
ee/spec/frontend/analytics/cycle_analytics/components/stage_table_spec.js
View file @
20f46eb4
...
...
@@ -247,7 +247,7 @@ describe('StageTable', () => {
});
it
(
'
will display the loading icon
'
,
()
=>
{
expect
(
wrapper
.
find
(
GlLoadingIcon
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
Component
(
GlLoadingIcon
).
exists
()).
toBe
(
true
);
});
it
(
'
will not display pagination
'
,
()
=>
{
...
...
@@ -261,7 +261,7 @@ describe('StageTable', () => {
});
it
(
'
will render the empty state
'
,
()
=>
{
expect
(
wrapper
.
find
(
GlEmptyState
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
Component
(
GlEmptyState
).
exists
()).
toBe
(
true
);
});
it
(
'
will display the default no data message
'
,
()
=>
{
...
...
ee/spec/frontend/analytics/cycle_analytics/components/tasks_by_type/tasks_by_type_filters_spec.js
View file @
20f46eb4
...
...
@@ -18,9 +18,10 @@ import { groupLabels } from '../../mock_data';
const
selectedLabelIds
=
[
groupLabels
[
0
].
id
];
const
findSubjectFilters
=
(
ctx
)
=>
ctx
.
find
(
GlSegmentedControl
);
const
findSubjectFilters
=
(
ctx
)
=>
ctx
.
find
Component
(
GlSegmentedControl
);
const
findSelectedSubjectFilters
=
(
ctx
)
=>
findSubjectFilters
(
ctx
).
attributes
(
'
checked
'
);
const
findDropdownLabels
=
(
ctx
)
=>
ctx
.
find
(
LabelsSelector
).
findAll
(
GlDropdownItem
);
const
findDropdownLabels
=
(
ctx
)
=>
ctx
.
findComponent
(
LabelsSelector
).
findAllComponents
(
GlDropdownItem
);
const
selectLabelAtIndex
=
(
ctx
,
index
)
=>
{
findDropdownLabels
(
ctx
).
at
(
index
).
trigger
(
'
click
'
);
...
...
@@ -117,7 +118,7 @@ describe('TasksByTypeFilters', () => {
it
(
'
emits the `update-filter` event when a label is selected
'
,
()
=>
{
expect
(
wrapper
.
emitted
(
'
update-filter
'
)).
toBeUndefined
();
wrapper
.
find
(
LabelsSelector
).
vm
.
$emit
(
'
select-label
'
,
groupLabels
[
0
].
id
);
wrapper
.
find
Component
(
LabelsSelector
).
vm
.
$emit
(
'
select-label
'
,
groupLabels
[
0
].
id
);
expect
(
wrapper
.
emitted
(
'
update-filter
'
)).
toBeDefined
();
expect
(
wrapper
.
emitted
(
'
update-filter
'
)[
0
]).
toEqual
([
...
...
@@ -161,7 +162,7 @@ describe('TasksByTypeFilters', () => {
});
return
waitForPromises
().
then
(()
=>
{
wrapper
.
find
(
LabelsSelector
).
vm
.
$emit
(
'
select-label
'
,
groupLabels
[
2
].
id
);
wrapper
.
find
Component
(
LabelsSelector
).
vm
.
$emit
(
'
select-label
'
,
groupLabels
[
2
].
id
);
});
});
...
...
ee/spec/frontend/analytics/cycle_analytics/components/type_of_work_charts_spec.js
View file @
20f46eb4
...
...
@@ -51,9 +51,9 @@ describe('TypeOfWorkCharts', () => {
let
wrapper
=
null
;
const
findSubjectFilters
=
(
_wrapper
)
=>
_wrapper
.
find
(
TasksByTypeFilters
);
const
findTasksByTypeChart
=
(
_wrapper
)
=>
_wrapper
.
find
(
TasksByTypeChart
);
const
findLoader
=
(
_wrapper
)
=>
_wrapper
.
find
(
ChartSkeletonLoader
);
const
findSubjectFilters
=
(
_wrapper
)
=>
_wrapper
.
find
Component
(
TasksByTypeFilters
);
const
findTasksByTypeChart
=
(
_wrapper
)
=>
_wrapper
.
find
Component
(
TasksByTypeChart
);
const
findLoader
=
(
_wrapper
)
=>
_wrapper
.
find
Component
(
ChartSkeletonLoader
);
const
selectedFilterText
=
"
Type of work Showing data for group 'Gitlab Org' from Dec 11, 2019 to Jan 10, 2020
"
;
...
...
ee/spec/frontend/analytics/cycle_analytics/components/value_stream_form_spec.js
View file @
20f46eb4
...
...
@@ -273,7 +273,10 @@ describe('ValueStreamForm', () => {
it
(
'
validates existing fields when clicked
'
,
async
()
=>
{
expect
(
wrapper
.
vm
.
nameError
).
toEqual
([]);
wrapper
.
findByTestId
(
'
create-value-stream-name
'
).
find
(
GlFormInput
).
vm
.
$emit
(
'
input
'
,
''
);
wrapper
.
findByTestId
(
'
create-value-stream-name
'
)
.
findComponent
(
GlFormInput
)
.
vm
.
$emit
(
'
input
'
,
''
);
await
clickAddStage
();
expect
(
wrapper
.
vm
.
nameError
).
toEqual
([
'
Name is required
'
]);
...
...
ee/spec/frontend/analytics/cycle_analytics/helpers.js
View file @
20f46eb4
...
...
@@ -19,7 +19,7 @@ export function renderTotalTime(selector, element, totalTime = {}) {
export
const
shouldFlashAMessage
=
(
msg
=
''
)
=>
expect
(
document
.
querySelector
(
'
.flash-container .flash-text
'
).
innerText
.
trim
()).
toBe
(
msg
);
export
const
findDropdownItems
=
(
wrapper
)
=>
wrapper
.
findAll
(
GlDropdownItem
);
export
const
findDropdownItems
=
(
wrapper
)
=>
wrapper
.
findAll
Components
(
GlDropdownItem
);
export
const
findDropdownItemText
=
(
wrapper
)
=>
findDropdownItems
(
wrapper
).
wrappers
.
map
((
w
)
=>
w
.
text
());
...
...
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