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
ad51ab31
Commit
ad51ab31
authored
Mar 05, 2018
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix karma tests
parent
283183d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletion
+16
-1
spec/javascripts/monitoring/dashboard_spec.js
spec/javascripts/monitoring/dashboard_spec.js
+16
-1
No files found.
spec/javascripts/monitoring/dashboard_spec.js
View file @
ad51ab31
...
@@ -8,6 +8,20 @@ describe('Dashboard', () => {
...
@@ -8,6 +8,20 @@ describe('Dashboard', () => {
const
fixtureName
=
'
environments/metrics/metrics.html.raw
'
;
const
fixtureName
=
'
environments/metrics/metrics.html.raw
'
;
let
DashboardComponent
;
let
DashboardComponent
;
let
component
;
let
component
;
const
propsData
=
{
hasMetrics
:
'
false
'
,
documentationPath
:
'
/path/to/docs
'
,
settingsPath
:
'
/path/to/settings
'
,
clustersPath
:
'
/path/to/clusters
'
,
tagsPath
:
'
/path/to/tags
'
,
projectPath
:
'
/path/to/project
'
,
metricsEndpoint
:
mockApiEndpoint
,
deploymentEndpoint
:
'
/endpoint/deployments
'
,
emptyGettingStartedSvgPath
:
'
/path/to/getting-started.svg
'
,
emptyLoadingSvgPath
:
'
/path/to/loading.svg
'
,
emptyUnableToConnectSvgPath
:
'
/path/to/unable-to-connect.svg
'
,
};
preloadFixtures
(
fixtureName
);
preloadFixtures
(
fixtureName
);
beforeEach
(()
=>
{
beforeEach
(()
=>
{
...
@@ -19,6 +33,7 @@ describe('Dashboard', () => {
...
@@ -19,6 +33,7 @@ describe('Dashboard', () => {
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
DashboardComponent
({
component
=
new
DashboardComponent
({
el
:
document
.
querySelector
(
'
#prometheus-graphs
'
),
el
:
document
.
querySelector
(
'
#prometheus-graphs
'
),
propsData
,
});
});
component
.
$mount
();
component
.
$mount
();
...
@@ -30,7 +45,6 @@ describe('Dashboard', () => {
...
@@ -30,7 +45,6 @@ describe('Dashboard', () => {
describe
(
'
requests information to the server
'
,
()
=>
{
describe
(
'
requests information to the server
'
,
()
=>
{
let
mock
;
let
mock
;
beforeEach
(()
=>
{
beforeEach
(()
=>
{
document
.
querySelector
(
'
#prometheus-graphs
'
).
setAttribute
(
'
data-has-metrics
'
,
'
true
'
);
mock
=
new
MockAdapter
(
axios
);
mock
=
new
MockAdapter
(
axios
);
mock
.
onGet
(
mockApiEndpoint
).
reply
(
200
,
{
mock
.
onGet
(
mockApiEndpoint
).
reply
(
200
,
{
metricsGroupsAPIResponse
,
metricsGroupsAPIResponse
,
...
@@ -44,6 +58,7 @@ describe('Dashboard', () => {
...
@@ -44,6 +58,7 @@ describe('Dashboard', () => {
it
(
'
shows up a loading state
'
,
(
done
)
=>
{
it
(
'
shows up a loading state
'
,
(
done
)
=>
{
component
=
new
DashboardComponent
({
component
=
new
DashboardComponent
({
el
:
document
.
querySelector
(
'
#prometheus-graphs
'
),
el
:
document
.
querySelector
(
'
#prometheus-graphs
'
),
propsData
:
{
...
propsData
,
hasMetrics
:
'
true
'
},
});
});
component
.
$mount
();
component
.
$mount
();
Vue
.
nextTick
(()
=>
{
Vue
.
nextTick
(()
=>
{
...
...
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