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
Léo-Paul Géneau
gitlab-ce
Commits
57d1ddff
Commit
57d1ddff
authored
Mar 06, 2018
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replace fixture with simple mount point
parent
bae88da8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
39 deletions
+6
-39
spec/javascripts/fixtures/environments.rb
spec/javascripts/fixtures/environments.rb
+0
-30
spec/javascripts/monitoring/dashboard_spec.js
spec/javascripts/monitoring/dashboard_spec.js
+6
-9
No files found.
spec/javascripts/fixtures/environments.rb
deleted
100644 → 0
View file @
bae88da8
require
'spec_helper'
describe
Projects
::
EnvironmentsController
,
'(JavaScript fixtures)'
,
type: :controller
do
include
JavaScriptFixturesHelpers
let
(
:admin
)
{
create
(
:admin
)
}
let
(
:namespace
)
{
create
(
:namespace
,
name:
'frontend-fixtures'
)}
let
(
:project
)
{
create
(
:project_empty_repo
,
namespace:
namespace
,
path:
'environments-project'
)
}
let
(
:environment
)
{
create
(
:environment
,
name:
'production'
,
project:
project
)
}
render_views
before
(
:all
)
do
clean_frontend_fixtures
(
'environments/metrics'
)
end
before
do
sign_in
(
admin
)
end
it
'environments/metrics/metrics.html.raw'
do
|
example
|
get
:metrics
,
namespace_id:
project
.
namespace
,
project_id:
project
,
id:
environment
.
id
expect
(
response
).
to
be_success
store_frontend_fixture
(
response
,
example
.
description
)
end
end
spec/javascripts/monitoring/dashboard_spec.js
View file @
57d1ddff
...
@@ -5,7 +5,6 @@ import axios from '~/lib/utils/axios_utils';
...
@@ -5,7 +5,6 @@ import axios from '~/lib/utils/axios_utils';
import
{
metricsGroupsAPIResponse
,
mockApiEndpoint
}
from
'
./mock_data
'
;
import
{
metricsGroupsAPIResponse
,
mockApiEndpoint
}
from
'
./mock_data
'
;
describe
(
'
Dashboard
'
,
()
=>
{
describe
(
'
Dashboard
'
,
()
=>
{
const
fixtureName
=
'
environments/metrics/metrics.html.raw
'
;
let
DashboardComponent
;
let
DashboardComponent
;
const
propsData
=
{
const
propsData
=
{
...
@@ -22,21 +21,19 @@ describe('Dashboard', () => {
...
@@ -22,21 +21,19 @@ describe('Dashboard', () => {
emptyUnableToConnectSvgPath
:
'
/path/to/unable-to-connect.svg
'
,
emptyUnableToConnectSvgPath
:
'
/path/to/unable-to-connect.svg
'
,
};
};
preloadFixtures
(
fixtureName
);
beforeEach
(()
=>
{
beforeEach
(()
=>
{
loadFixtures
(
fixtureName
);
setFixtures
(
'
<div class="prometheus-graphs"></div>
'
);
DashboardComponent
=
Vue
.
extend
(
Dashboard
);
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
'
,
()
=>
{
const
component
=
new
DashboardComponent
({
const
component
=
new
DashboardComponent
({
el
:
document
.
querySelector
(
'
#
prometheus-graphs
'
),
el
:
document
.
querySelector
(
'
.
prometheus-graphs
'
),
propsData
,
propsData
,
});
});
expect
(
component
.
$el
.
querySelector
(
'
#
prometheus-graphs
'
)).
toBe
(
null
);
expect
(
component
.
$el
.
querySelector
(
'
.
prometheus-graphs
'
)).
toBe
(
null
);
expect
(
component
.
state
).
toEqual
(
'
gettingStarted
'
);
expect
(
component
.
state
).
toEqual
(
'
gettingStarted
'
);
});
});
});
});
...
@@ -54,7 +51,7 @@ describe('Dashboard', () => {
...
@@ -54,7 +51,7 @@ describe('Dashboard', () => {
it
(
'
shows up a loading state
'
,
(
done
)
=>
{
it
(
'
shows up a loading state
'
,
(
done
)
=>
{
const
component
=
new
DashboardComponent
({
const
component
=
new
DashboardComponent
({
el
:
document
.
querySelector
(
'
#
prometheus-graphs
'
),
el
:
document
.
querySelector
(
'
.
prometheus-graphs
'
),
propsData
:
{
...
propsData
,
hasMetrics
:
true
},
propsData
:
{
...
propsData
,
hasMetrics
:
true
},
});
});
...
@@ -66,7 +63,7 @@ describe('Dashboard', () => {
...
@@ -66,7 +63,7 @@ describe('Dashboard', () => {
it
(
'
hides the legend when showLegend is false
'
,
(
done
)
=>
{
it
(
'
hides the legend when showLegend is false
'
,
(
done
)
=>
{
const
component
=
new
DashboardComponent
({
const
component
=
new
DashboardComponent
({
el
:
document
.
querySelector
(
'
#
prometheus-graphs
'
),
el
:
document
.
querySelector
(
'
.
prometheus-graphs
'
),
propsData
:
{
...
propsData
,
hasMetrics
:
true
,
showLegend
:
false
},
propsData
:
{
...
propsData
,
hasMetrics
:
true
,
showLegend
:
false
},
});
});
...
@@ -80,7 +77,7 @@ describe('Dashboard', () => {
...
@@ -80,7 +77,7 @@ describe('Dashboard', () => {
it
(
'
hides the group panels when showPanels is false
'
,
(
done
)
=>
{
it
(
'
hides the group panels when showPanels is false
'
,
(
done
)
=>
{
const
component
=
new
DashboardComponent
({
const
component
=
new
DashboardComponent
({
el
:
document
.
querySelector
(
'
#
prometheus-graphs
'
),
el
:
document
.
querySelector
(
'
.
prometheus-graphs
'
),
propsData
:
{
...
propsData
,
hasMetrics
:
true
,
showPanels
:
false
},
propsData
:
{
...
propsData
,
hasMetrics
:
true
,
showPanels
:
false
},
});
});
...
...
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