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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
89c8bd4e
Commit
89c8bd4e
authored
Apr 04, 2018
by
Jose Ivan Vargas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added specs
parent
af871639
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6543 additions
and
8281 deletions
+6543
-8281
spec/javascripts/monitoring/graph/legend_spec.js
spec/javascripts/monitoring/graph/legend_spec.js
+0
-26
spec/javascripts/monitoring/graph/track_info_spec.js
spec/javascripts/monitoring/graph/track_info_spec.js
+31
-0
spec/javascripts/monitoring/graph/track_line_spec.js
spec/javascripts/monitoring/graph/track_line_spec.js
+35
-0
spec/javascripts/monitoring/mock_data.js
spec/javascripts/monitoring/mock_data.js
+6477
-8255
No files found.
spec/javascripts/monitoring/graph/legend_spec.js
View file @
89c8bd4e
...
...
@@ -20,32 +20,6 @@ describe('Legend Component', () => {
Legend
=
Vue
.
extend
(
GraphLegend
);
});
describe
(
'
Methods
'
,
()
=>
{
beforeEach
(()
=>
{
vm
=
mountComponent
(
Legend
,
{
legendTitle
:
'
legend
'
,
timeSeries
,
currentDataIndex
:
0
,
unitOfDisplay
:
'
Req/Sec
'
,
});
});
it
(
'
strokeDashArray
'
,
()
=>
{
const
dashedArray
=
vm
.
strokeDashArray
(
'
dashed
'
);
const
dottedArray
=
vm
.
strokeDashArray
(
'
dotted
'
);
expect
(
dashedArray
).
toEqual
(
'
6, 3
'
);
expect
(
dottedArray
).
toEqual
(
'
3, 3
'
);
});
it
(
'
summaryMetrics gets the average and max of a series
'
,
()
=>
{
const
summary
=
vm
.
summaryMetrics
(
timeSeries
[
0
]);
expect
(
summary
.
indexOf
(
'
Max
'
)).
not
.
toEqual
(
-
1
);
expect
(
summary
.
indexOf
(
'
Avg
'
)).
not
.
toEqual
(
-
1
);
});
});
describe
(
'
View
'
,
()
=>
{
beforeEach
(()
=>
{
vm
=
mountComponent
(
Legend
,
{
...
...
spec/javascripts/monitoring/graph/track_info_spec.js
0 → 100644
View file @
89c8bd4e
import
Vue
from
'
vue
'
;
import
TrackInfo
from
'
~/monitoring/components/graph/track_info.vue
'
;
import
mountComponent
from
'
spec/helpers/vue_mount_component_helper
'
;
import
createTimeSeries
from
'
~/monitoring/utils/multiple_time_series
'
;
import
{
singleRowMetricsMultipleSeries
,
convertDatesMultipleSeries
}
from
'
../mock_data
'
;
const
convertedMetrics
=
convertDatesMultipleSeries
(
singleRowMetricsMultipleSeries
);
const
timeSeries
=
createTimeSeries
(
convertedMetrics
[
0
].
queries
,
500
,
300
,
120
);
describe
(
'
TrackInfo component
'
,
()
=>
{
let
vm
;
let
Component
;
beforeEach
(()
=>
{
Component
=
Vue
.
extend
(
TrackInfo
);
});
afterEach
(()
=>
{
vm
.
$destroy
();
});
describe
(
'
Computed props
'
,
()
=>
{
beforeEach
(()
=>
{
vm
=
mountComponent
(
Component
,
{
track
:
timeSeries
[
0
]
});
});
it
(
'
summaryMetrics
'
,
()
=>
{
expect
(
vm
.
summaryMetrics
).
toEqual
(
'
Avg: 0.000 · Max: 0.000
'
);
});
});
});
spec/javascripts/monitoring/graph/track_line_spec.js
0 → 100644
View file @
89c8bd4e
import
Vue
from
'
vue
'
;
import
TrackLine
from
'
~/monitoring/components/graph/track_line.vue
'
;
import
mountComponent
from
'
spec/helpers/vue_mount_component_helper
'
;
import
createTimeSeries
from
'
~/monitoring/utils/multiple_time_series
'
;
import
{
singleRowMetricsMultipleSeries
,
convertDatesMultipleSeries
}
from
'
../mock_data
'
;
const
convertedMetrics
=
convertDatesMultipleSeries
(
singleRowMetricsMultipleSeries
);
const
timeSeries
=
createTimeSeries
(
convertedMetrics
[
0
].
queries
,
500
,
300
,
120
);
describe
(
'
TrackLine component
'
,
()
=>
{
let
vm
;
let
Component
;
beforeEach
(()
=>
{
Component
=
Vue
.
extend
(
TrackLine
);
});
afterEach
(()
=>
{
vm
.
$destroy
();
});
describe
(
'
Computed props
'
,
()
=>
{
beforeEach
(()
=>
{
vm
=
mountComponent
(
Component
,
{
track
:
timeSeries
[
0
]
});
});
it
(
'
strokeDashArray
'
,
()
=>
{
const
dashedArray
=
vm
.
strokeDashArray
(
'
dashed
'
);
const
dottedArray
=
vm
.
strokeDashArray
(
'
dotted
'
);
expect
(
dashedArray
).
toEqual
(
'
6, 3
'
);
expect
(
dottedArray
).
toEqual
(
'
3, 3
'
);
});
});
});
spec/javascripts/monitoring/mock_data.js
View file @
89c8bd4e
This diff is collapsed.
Click to expand it.
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