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
dddfd010
Commit
dddfd010
authored
Sep 13, 2021
by
Ezekiel Kigbo
Committed by
Simon Knox
Sep 13, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix mock duration data id's
Uses the fixture generated stages for the duration chart mock data.
parent
02c9c7a3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
32 deletions
+17
-32
ee/spec/frontend/analytics/cycle_analytics/mock_data.js
ee/spec/frontend/analytics/cycle_analytics/mock_data.js
+7
-12
ee/spec/frontend/analytics/cycle_analytics/store/modules/duration_chart/actions_spec.js
...le_analytics/store/modules/duration_chart/actions_spec.js
+10
-20
No files found.
ee/spec/frontend/analytics/cycle_analytics/mock_data.js
View file @
dddfd010
...
...
@@ -239,24 +239,19 @@ export const rawDurationData = [
},
];
export
const
transformedDurationData
=
[
{
id
:
1
,
selected
:
true
,
data
:
rawDurationData
,
},
{
id
:
2
,
selected
:
true
,
data
:
rawDurationData
,
},
];
export
const
transformedDurationData
=
allowedStages
.
map
(({
id
})
=>
({
id
,
selected
:
true
,
data
:
rawDurationData
,
}));
export
const
flattenedDurationData
=
[
{
average_duration_in_seconds
:
1234000
,
date
:
'
2019-01-01
'
},
{
average_duration_in_seconds
:
4321000
,
date
:
'
2019-01-02
'
},
{
average_duration_in_seconds
:
1234000
,
date
:
'
2019-01-01
'
},
{
average_duration_in_seconds
:
4321000
,
date
:
'
2019-01-02
'
},
{
average_duration_in_seconds
:
1234000
,
date
:
'
2019-01-01
'
},
{
average_duration_in_seconds
:
4321000
,
date
:
'
2019-01-02
'
},
];
export
const
durationChartPlottableData
=
[
...
...
ee/spec/frontend/analytics/cycle_analytics/store/modules/duration_chart/actions_spec.js
View file @
dddfd010
...
...
@@ -9,7 +9,7 @@ import { createdAfter, createdBefore, group } from 'jest/cycle_analytics/mock_da
import
createFlash
from
'
~/flash
'
;
import
httpStatusCodes
from
'
~/lib/utils/http_status
'
;
import
{
allowedStages
as
s
tages
,
allowedStages
as
activeS
tages
,
rawDurationData
,
transformedDurationData
,
endpoints
,
...
...
@@ -18,9 +18,7 @@ import {
jest
.
mock
(
'
~/flash
'
);
const
selectedGroup
=
{
fullPath
:
group
.
path
};
const
[
stage1
,
stage2
]
=
stages
;
const
hiddenStage
=
{
...
stage1
,
hidden
:
true
,
id
:
3
,
slug
:
3
};
const
activeStages
=
[
stage1
,
stage2
];
const
hiddenStage
=
{
...
activeStages
[
0
],
hidden
:
true
,
id
:
3
,
slug
:
3
};
const
[
selectedValueStream
]
=
valueStreams
;
const
error
=
new
Error
(
`Request failed with status code
${
httpStatusCodes
.
BAD_REQUEST
}
`
);
...
...
@@ -197,7 +195,7 @@ describe('DurationChart actions', () => {
testAction
(
actions
.
updateSelectedDurationChartStages
,
[...
stages
]
,
activeStages
,
stateWithDurationData
,
[
{
...
...
@@ -219,7 +217,7 @@ describe('DurationChart actions', () => {
testAction
(
actions
.
updateSelectedDurationChartStages
,
[
stages
[
0
]],
[
activeStages
[
0
],
activeStages
[
1
]],
stateWithDurationData
,
[
{
...
...
@@ -227,10 +225,8 @@ describe('DurationChart actions', () => {
payload
:
{
updatedDurationStageData
:
[
transformedDurationData
[
0
],
{
...
transformedDurationData
[
1
],
selected
:
false
,
},
transformedDurationData
[
1
],
{
...
transformedDurationData
[
2
],
selected
:
false
},
],
},
},
...
...
@@ -253,16 +249,10 @@ describe('DurationChart actions', () => {
{
type
:
types
.
UPDATE_SELECTED_DURATION_CHART_STAGES
,
payload
:
{
updatedDurationStageData
:
[
{
...
transformedDurationData
[
0
],
selected
:
false
,
},
{
...
transformedDurationData
[
1
],
selected
:
false
,
},
],
updatedDurationStageData
:
transformedDurationData
.
map
((
d
)
=>
({
...
d
,
selected
:
false
,
})),
},
},
],
...
...
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