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
c91fbebf
Commit
c91fbebf
authored
Jul 15, 2021
by
Simon Knox
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '12100-guideline-edge-cases' into 'master'
Fix burnup guideline See merge request gitlab-org/gitlab!65958
parents
856a51d3
1631fca2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
4 deletions
+30
-4
ee/app/assets/javascripts/burndown_chart/components/burndown_chart.vue
.../javascripts/burndown_chart/components/burndown_chart.vue
+4
-2
ee/spec/frontend/burndown_chart/components/burndown_chart_spec.js
...frontend/burndown_chart/components/burndown_chart_spec.js
+26
-2
No files found.
ee/app/assets/javascripts/burndown_chart/components/burndown_chart.vue
View file @
c91fbebf
...
...
@@ -76,8 +76,10 @@ export default {
},
];
if
(
series
[
0
]
&&
series
[
0
].
data
.
length
>=
2
)
{
const
idealStart
=
[
this
.
startDate
,
data
[
0
][
1
]];
if
(
data
.
length
>
0
)
{
const
zeroStart
=
[
this
.
startDate
,
0
];
const
firstNonZero
=
data
.
find
((
dataObj
)
=>
dataObj
[
1
]
!==
0
)
||
zeroStart
;
const
idealStart
=
[
this
.
startDate
,
firstNonZero
[
1
]];
const
idealEnd
=
[
this
.
dueDate
,
0
];
const
idealData
=
[
idealStart
,
idealEnd
];
...
...
ee/spec/frontend/burndown_chart/components/burndown_chart_spec.js
View file @
c91fbebf
...
...
@@ -35,10 +35,10 @@ describe('burndown_chart', () => {
expect
(
findChart
().
exists
()).
toBe
(
true
);
});
describe
(
'
with
single point
'
,
()
=>
{
describe
(
'
with
no points
'
,
()
=>
{
it
(
'
does not show guideline
'
,
()
=>
{
createComponent
({
openIssuesCount
:
[
{
'
2019-08-07T00:00:00.000Z
'
:
100
}
],
openIssuesCount
:
[],
});
const
data
=
wrapper
.
vm
.
dataSeries
;
...
...
@@ -47,6 +47,30 @@ describe('burndown_chart', () => {
});
});
describe
(
'
with single point and zero issues
'
,
()
=>
{
it
(
'
shows guideline
'
,
()
=>
{
createComponent
({
openIssuesCount
:
[{
'
2019-08-07T00:00:00.000Z
'
:
0
}],
});
const
data
=
wrapper
.
vm
.
dataSeries
;
expect
(
data
).
toHaveLength
(
2
);
expect
(
data
[
1
].
name
).
toBe
(
'
Guideline
'
);
});
});
describe
(
'
with single point
'
,
()
=>
{
it
(
'
shows guideline
'
,
()
=>
{
createComponent
({
openIssuesCount
:
[{
'
2019-08-07T00:00:00.000Z
'
:
100
}],
});
const
data
=
wrapper
.
vm
.
dataSeries
;
expect
(
data
).
toHaveLength
(
2
);
expect
(
data
[
1
].
name
).
toBe
(
'
Guideline
'
);
});
});
describe
(
'
with multiple points
'
,
()
=>
{
beforeEach
(()
=>
{
createComponent
({
...
...
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