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
4b892a5f
Commit
4b892a5f
authored
Aug 30, 2017
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update specs to match reorganized monitoring components
parent
147d55d2
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
39 additions
and
36 deletions
+39
-36
spec/javascripts/monitoring/dashboard_spec.js
spec/javascripts/monitoring/dashboard_spec.js
+6
-6
spec/javascripts/monitoring/dashboard_state_spec.js
spec/javascripts/monitoring/dashboard_state_spec.js
+3
-3
spec/javascripts/monitoring/graph/deployment_spec.js
spec/javascripts/monitoring/graph/deployment_spec.js
+3
-3
spec/javascripts/monitoring/graph/flag_spec.js
spec/javascripts/monitoring/graph/flag_spec.js
+3
-3
spec/javascripts/monitoring/graph/legend_spec.js
spec/javascripts/monitoring/graph/legend_spec.js
+3
-3
spec/javascripts/monitoring/graph_row_spec.js
spec/javascripts/monitoring/graph_row_spec.js
+8
-3
spec/javascripts/monitoring/graph_spec.js
spec/javascripts/monitoring/graph_spec.js
+13
-15
No files found.
spec/javascripts/monitoring/
monitoring
_spec.js
→
spec/javascripts/monitoring/
dashboard
_spec.js
View file @
4b892a5f
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
Monitoring
from
'
~/monitoring/components/monitoring
.vue
'
;
import
Dashboard
from
'
~/monitoring/components/dashboard
.vue
'
;
import
{
MonitorMockInterceptor
}
from
'
./mock_data
'
;
import
{
MonitorMockInterceptor
}
from
'
./mock_data
'
;
describe
(
'
Monitoring
'
,
()
=>
{
describe
(
'
Dashboard
'
,
()
=>
{
const
fixtureName
=
'
environments/metrics/metrics.html.raw
'
;
const
fixtureName
=
'
environments/metrics/metrics.html.raw
'
;
let
Monitoring
Component
;
let
Dashboard
Component
;
let
component
;
let
component
;
preloadFixtures
(
fixtureName
);
preloadFixtures
(
fixtureName
);
beforeEach
(()
=>
{
beforeEach
(()
=>
{
loadFixtures
(
fixtureName
);
loadFixtures
(
fixtureName
);
MonitoringComponent
=
Vue
.
extend
(
Monitoring
);
DashboardComponent
=
Vue
.
extend
(
Dashboard
);
});
});
describe
(
'
no metrics are available yet
'
,
()
=>
{
describe
(
'
no metrics are available yet
'
,
()
=>
{
it
(
'
shows a getting started empty state when no metrics are present
'
,
()
=>
{
it
(
'
shows a getting started empty state when no metrics are present
'
,
()
=>
{
component
=
new
Monitoring
Component
({
component
=
new
Dashboard
Component
({
el
:
document
.
querySelector
(
'
#prometheus-graphs
'
),
el
:
document
.
querySelector
(
'
#prometheus-graphs
'
),
});
});
...
@@ -36,7 +36,7 @@ describe('Monitoring', () => {
...
@@ -36,7 +36,7 @@ describe('Monitoring', () => {
});
});
it
(
'
shows up a loading state
'
,
(
done
)
=>
{
it
(
'
shows up a loading state
'
,
(
done
)
=>
{
component
=
new
Monitoring
Component
({
component
=
new
Dashboard
Component
({
el
:
document
.
querySelector
(
'
#prometheus-graphs
'
),
el
:
document
.
querySelector
(
'
#prometheus-graphs
'
),
});
});
component
.
$mount
();
component
.
$mount
();
...
...
spec/javascripts/monitoring/
monitoring
_state_spec.js
→
spec/javascripts/monitoring/
dashboard
_state_spec.js
View file @
4b892a5f
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
MonitoringState
from
'
~/monitoring/components/monitoring
_state.vue
'
;
import
EmptyState
from
'
~/monitoring/components/empty
_state.vue
'
;
import
{
statePaths
}
from
'
./mock_data
'
;
import
{
statePaths
}
from
'
./mock_data
'
;
const
createComponent
=
(
propsData
)
=>
{
const
createComponent
=
(
propsData
)
=>
{
const
Component
=
Vue
.
extend
(
Monitoring
State
);
const
Component
=
Vue
.
extend
(
Empty
State
);
return
new
Component
({
return
new
Component
({
propsData
,
propsData
,
...
@@ -14,7 +14,7 @@ function getTextFromNode(component, selector) {
...
@@ -14,7 +14,7 @@ function getTextFromNode(component, selector) {
return
component
.
$el
.
querySelector
(
selector
).
firstChild
.
nodeValue
.
trim
();
return
component
.
$el
.
querySelector
(
selector
).
firstChild
.
nodeValue
.
trim
();
}
}
describe
(
'
Monitoring
State
'
,
()
=>
{
describe
(
'
Empty
State
'
,
()
=>
{
describe
(
'
Computed props
'
,
()
=>
{
describe
(
'
Computed props
'
,
()
=>
{
it
(
'
currentState
'
,
()
=>
{
it
(
'
currentState
'
,
()
=>
{
const
component
=
createComponent
({
const
component
=
createComponent
({
...
...
spec/javascripts/monitoring/
monitoring_
deployment_spec.js
→
spec/javascripts/monitoring/
graph/
deployment_spec.js
View file @
4b892a5f
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
MonitoringState
from
'
~/monitoring/components/monitoring_
deployment.vue
'
;
import
GraphDeployment
from
'
~/monitoring/components/graph/
deployment.vue
'
;
import
{
deploymentData
}
from
'
./mock_data
'
;
import
{
deploymentData
}
from
'
.
.
/mock_data
'
;
const
createComponent
=
(
propsData
)
=>
{
const
createComponent
=
(
propsData
)
=>
{
const
Component
=
Vue
.
extend
(
MonitoringState
);
const
Component
=
Vue
.
extend
(
GraphDeployment
);
return
new
Component
({
return
new
Component
({
propsData
,
propsData
,
...
...
spec/javascripts/monitoring/
monitoring_
flag_spec.js
→
spec/javascripts/monitoring/
graph/
flag_spec.js
View file @
4b892a5f
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
MonitoringFlag
from
'
~/monitoring/components/monitoring_
flag.vue
'
;
import
GraphFlag
from
'
~/monitoring/components/graph/
flag.vue
'
;
const
createComponent
=
(
propsData
)
=>
{
const
createComponent
=
(
propsData
)
=>
{
const
Component
=
Vue
.
extend
(
Monitoring
Flag
);
const
Component
=
Vue
.
extend
(
Graph
Flag
);
return
new
Component
({
return
new
Component
({
propsData
,
propsData
,
...
@@ -14,7 +14,7 @@ function getCoordinate(component, selector, coordinate) {
...
@@ -14,7 +14,7 @@ function getCoordinate(component, selector, coordinate) {
return
parseInt
(
coordinateVal
,
10
);
return
parseInt
(
coordinateVal
,
10
);
}
}
describe
(
'
Monitoring
Flag
'
,
()
=>
{
describe
(
'
Graph
Flag
'
,
()
=>
{
it
(
'
has a line and a circle located at the currentXCoordinate and currentYCoordinate
'
,
()
=>
{
it
(
'
has a line and a circle located at the currentXCoordinate and currentYCoordinate
'
,
()
=>
{
const
component
=
createComponent
({
const
component
=
createComponent
({
currentXCoordinate
:
200
,
currentXCoordinate
:
200
,
...
...
spec/javascripts/monitoring/
monitoring_legends
_spec.js
→
spec/javascripts/monitoring/
graph/legend
_spec.js
View file @
4b892a5f
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
MonitoringLegends
from
'
~/monitoring/components/monitoring_legends
.vue
'
;
import
GraphLegend
from
'
~/monitoring/components/graph/legend
.vue
'
;
import
measurements
from
'
~/monitoring/utils/measurements
'
;
import
measurements
from
'
~/monitoring/utils/measurements
'
;
const
createComponent
=
(
propsData
)
=>
{
const
createComponent
=
(
propsData
)
=>
{
const
Component
=
Vue
.
extend
(
MonitoringLegends
);
const
Component
=
Vue
.
extend
(
GraphLegend
);
return
new
Component
({
return
new
Component
({
propsData
,
propsData
,
...
@@ -14,7 +14,7 @@ function getTextFromNode(component, selector) {
...
@@ -14,7 +14,7 @@ function getTextFromNode(component, selector) {
return
component
.
$el
.
querySelector
(
selector
).
firstChild
.
nodeValue
.
trim
();
return
component
.
$el
.
querySelector
(
selector
).
firstChild
.
nodeValue
.
trim
();
}
}
describe
(
'
MonitoringLegends
'
,
()
=>
{
describe
(
'
GraphLegend
'
,
()
=>
{
describe
(
'
Computed props
'
,
()
=>
{
describe
(
'
Computed props
'
,
()
=>
{
it
(
'
textTransform
'
,
()
=>
{
it
(
'
textTransform
'
,
()
=>
{
const
component
=
createComponent
({
const
component
=
createComponent
({
...
...
spec/javascripts/monitoring/
monitoring
_row_spec.js
→
spec/javascripts/monitoring/
graph
_row_spec.js
View file @
4b892a5f
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
MonitoringRow
from
'
~/monitoring/components/monitoring_row.vue
'
;
import
GraphRow
from
'
~/monitoring/components/graph_row.vue
'
;
import
MonitoringMixins
from
'
~/monitoring/mixins/monitoring_mixins
'
;
import
{
deploymentData
,
singleRowMetrics
}
from
'
./mock_data
'
;
import
{
deploymentData
,
singleRowMetrics
}
from
'
./mock_data
'
;
const
createComponent
=
(
propsData
)
=>
{
const
createComponent
=
(
propsData
)
=>
{
const
Component
=
Vue
.
extend
(
Monitoring
Row
);
const
Component
=
Vue
.
extend
(
Graph
Row
);
return
new
Component
({
return
new
Component
({
propsData
,
propsData
,
}).
$mount
();
}).
$mount
();
};
};
describe
(
'
MonitoringRow
'
,
()
=>
{
describe
(
'
GraphRow
'
,
()
=>
{
beforeEach
(()
=>
{
spyOn
(
MonitoringMixins
.
methods
,
'
formatDeployments
'
).
and
.
returnValue
({});
});
describe
(
'
Computed props
'
,
()
=>
{
describe
(
'
Computed props
'
,
()
=>
{
it
(
'
bootstrapClass is set to col-md-6 when rowData is higher/equal to 2
'
,
()
=>
{
it
(
'
bootstrapClass is set to col-md-6 when rowData is higher/equal to 2
'
,
()
=>
{
const
component
=
createComponent
({
const
component
=
createComponent
({
...
...
spec/javascripts/monitoring/
monitoring_column
_spec.js
→
spec/javascripts/monitoring/
graph
_spec.js
View file @
4b892a5f
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
_
from
'
underscore
'
;
import
_
from
'
underscore
'
;
import
MonitoringColumn
from
'
~/monitoring/components/monitoring_column
.vue
'
;
import
Graph
from
'
~/monitoring/components/graph
.vue
'
;
import
MonitoringMixins
from
'
~/monitoring/mixins/monitoring_mixins
'
;
import
MonitoringMixins
from
'
~/monitoring/mixins/monitoring_mixins
'
;
import
eventHub
from
'
~/monitoring/event_hub
'
;
import
eventHub
from
'
~/monitoring/event_hub
'
;
import
{
deploymentData
,
singleRowMetrics
}
from
'
./mock_data
'
;
import
{
deploymentData
,
singleRowMetrics
}
from
'
./mock_data
'
;
const
createComponent
=
(
propsData
)
=>
{
const
createComponent
=
(
propsData
)
=>
{
const
Component
=
Vue
.
extend
(
MonitoringColumn
);
const
Component
=
Vue
.
extend
(
Graph
);
return
new
Component
({
return
new
Component
({
propsData
,
propsData
,
}).
$mount
();
}).
$mount
();
};
};
describe
(
'
MonitoringColumn
'
,
()
=>
{
describe
(
'
Graph
'
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
spyOn
(
MonitoringMixins
.
methods
,
'
formatDeployments
'
).
and
.
callFake
(
function
fakeFormat
()
{
spyOn
(
MonitoringMixins
.
methods
,
'
formatDeployments
'
).
and
.
returnValue
({});
return
{};
});
});
});
it
(
'
has a title
'
,
()
=>
{
it
(
'
has a title
'
,
()
=>
{
const
component
=
createComponent
({
const
component
=
createComponent
({
column
Data
:
singleRowMetrics
[
0
],
graph
Data
:
singleRowMetrics
[
0
],
classType
:
'
col-md-6
'
,
classType
:
'
col-md-6
'
,
updateAspectRatio
:
false
,
updateAspectRatio
:
false
,
deploymentData
,
deploymentData
,
});
});
expect
(
component
.
$el
.
querySelector
(
'
.text-center
'
).
innerText
.
trim
()).
toBe
(
component
.
column
Data
.
title
);
expect
(
component
.
$el
.
querySelector
(
'
.text-center
'
).
innerText
.
trim
()).
toBe
(
component
.
graph
Data
.
title
);
});
});
it
(
'
creates a path for the line and area of the graph
'
,
(
done
)
=>
{
it
(
'
creates a path for the line and area of the graph
'
,
(
done
)
=>
{
const
component
=
createComponent
({
const
component
=
createComponent
({
column
Data
:
singleRowMetrics
[
0
],
graph
Data
:
singleRowMetrics
[
0
],
classType
:
'
col-md-6
'
,
classType
:
'
col-md-6
'
,
updateAspectRatio
:
false
,
updateAspectRatio
:
false
,
deploymentData
,
deploymentData
,
...
@@ -53,7 +51,7 @@ describe('MonitoringColumn', () => {
...
@@ -53,7 +51,7 @@ describe('MonitoringColumn', () => {
describe
(
'
Computed props
'
,
()
=>
{
describe
(
'
Computed props
'
,
()
=>
{
it
(
'
axisTransform translates an element Y position depending of its height
'
,
()
=>
{
it
(
'
axisTransform translates an element Y position depending of its height
'
,
()
=>
{
const
component
=
createComponent
({
const
component
=
createComponent
({
column
Data
:
singleRowMetrics
[
0
],
graph
Data
:
singleRowMetrics
[
0
],
classType
:
'
col-md-6
'
,
classType
:
'
col-md-6
'
,
updateAspectRatio
:
false
,
updateAspectRatio
:
false
,
deploymentData
,
deploymentData
,
...
@@ -66,7 +64,7 @@ describe('MonitoringColumn', () => {
...
@@ -66,7 +64,7 @@ describe('MonitoringColumn', () => {
it
(
'
outterViewBox gets a width and height property based on the DOM size of the element
'
,
()
=>
{
it
(
'
outterViewBox gets a width and height property based on the DOM size of the element
'
,
()
=>
{
const
component
=
createComponent
({
const
component
=
createComponent
({
column
Data
:
singleRowMetrics
[
0
],
graph
Data
:
singleRowMetrics
[
0
],
classType
:
'
col-md-6
'
,
classType
:
'
col-md-6
'
,
updateAspectRatio
:
false
,
updateAspectRatio
:
false
,
deploymentData
,
deploymentData
,
...
@@ -81,7 +79,7 @@ describe('MonitoringColumn', () => {
...
@@ -81,7 +79,7 @@ describe('MonitoringColumn', () => {
it
(
'
sends an event to the eventhub when it has finished resizing
'
,
(
done
)
=>
{
it
(
'
sends an event to the eventhub when it has finished resizing
'
,
(
done
)
=>
{
const
component
=
createComponent
({
const
component
=
createComponent
({
column
Data
:
singleRowMetrics
[
0
],
graph
Data
:
singleRowMetrics
[
0
],
classType
:
'
col-md-6
'
,
classType
:
'
col-md-6
'
,
updateAspectRatio
:
false
,
updateAspectRatio
:
false
,
deploymentData
,
deploymentData
,
...
@@ -97,13 +95,13 @@ describe('MonitoringColumn', () => {
...
@@ -97,13 +95,13 @@ describe('MonitoringColumn', () => {
it
(
'
has a title for the y-axis and the chart legend that comes from the backend
'
,
()
=>
{
it
(
'
has a title for the y-axis and the chart legend that comes from the backend
'
,
()
=>
{
const
component
=
createComponent
({
const
component
=
createComponent
({
column
Data
:
singleRowMetrics
[
0
],
graph
Data
:
singleRowMetrics
[
0
],
classType
:
'
col-md-6
'
,
classType
:
'
col-md-6
'
,
updateAspectRatio
:
false
,
updateAspectRatio
:
false
,
deploymentData
,
deploymentData
,
});
});
expect
(
component
.
yAxisLabel
).
toEqual
(
component
.
column
Data
.
y_label
);
expect
(
component
.
yAxisLabel
).
toEqual
(
component
.
graph
Data
.
y_label
);
expect
(
component
.
legendTitle
).
toEqual
(
component
.
column
Data
.
queries
[
0
].
label
);
expect
(
component
.
legendTitle
).
toEqual
(
component
.
graph
Data
.
queries
[
0
].
label
);
});
});
});
});
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