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
0a1879f6
Commit
0a1879f6
authored
Nov 21, 2019
by
Martin Wortschack
Committed by
Filipa Lacerda
Nov 21, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Productivity Analytics: Update specs for transformScatterData utility
parent
c2bd9591
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
10 deletions
+11
-10
ee/spec/frontend/analytics/productivity_analytics/utils_spec.js
...c/frontend/analytics/productivity_analytics/utils_spec.js
+11
-10
No files found.
ee/spec/frontend/analytics/productivity_analytics/utils_spec.js
View file @
0a1879f6
...
@@ -73,22 +73,23 @@ describe('Productivity Analytics utils', () => {
...
@@ -73,22 +73,23 @@ describe('Productivity Analytics utils', () => {
describe
(
'
transformScatterData
'
,
()
=>
{
describe
(
'
transformScatterData
'
,
()
=>
{
it
(
'
transforms the raw scatter data into a two-dimensional array and groups by date
'
,
()
=>
{
it
(
'
transforms the raw scatter data into a two-dimensional array and groups by date
'
,
()
=>
{
const
startDate
=
new
Date
(
'
2019-
08-01
'
);
const
startDate
=
new
Date
(
'
2019-
10-29
'
);
const
endDate
=
new
Date
(
'
2019-
08-03
'
);
const
endDate
=
new
Date
(
'
2019-
11-01
'
);
const
data
=
{
const
data
=
{
1
:
{
merged_at
:
'
2019-
08-01
T11:10:00.000Z
'
,
metric
:
10
},
1
:
{
merged_at
:
'
2019-
10-29
T11:10:00.000Z
'
,
metric
:
10
},
2
:
{
merged_at
:
'
2019-
08-01
T12:11:00.000Z
'
,
metric
:
20
},
2
:
{
merged_at
:
'
2019-
10-29
T12:11:00.000Z
'
,
metric
:
20
},
3
:
{
merged_at
:
'
2019-
08-02
T13:13:00.000Z
'
,
metric
:
30
},
3
:
{
merged_at
:
'
2019-
10-30
T13:13:00.000Z
'
,
metric
:
30
},
4
:
{
merged_at
:
'
2019-
08-03T14:14:00.000
Z
'
,
metric
:
40
},
4
:
{
merged_at
:
'
2019-
10-31T01:23:15.231
Z
'
,
metric
:
40
},
};
};
const
result
=
transformScatterData
(
data
,
startDate
,
endDate
);
const
result
=
transformScatterData
(
data
,
startDate
,
endDate
);
const
expected
=
[
const
expected
=
[
[
[
{
merged_at
:
'
2019-
08-01
T11:10:00.000Z
'
,
metric
:
10
},
{
merged_at
:
'
2019-
10-29
T11:10:00.000Z
'
,
metric
:
10
},
{
merged_at
:
'
2019-
08-01
T12:11:00.000Z
'
,
metric
:
20
},
{
merged_at
:
'
2019-
10-29
T12:11:00.000Z
'
,
metric
:
20
},
],
],
[{
merged_at
:
'
2019-08-02T13:13:00.000Z
'
,
metric
:
30
}],
[{
merged_at
:
'
2019-10-30T13:13:00.000Z
'
,
metric
:
30
}],
[{
merged_at
:
'
2019-08-03T14:14:00.000Z
'
,
metric
:
40
}],
[{
merged_at
:
'
2019-10-31T01:23:15.231Z
'
,
metric
:
40
}],
[],
];
];
expect
(
result
).
toEqual
(
expected
);
expect
(
result
).
toEqual
(
expected
);
});
});
...
...
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