summaryrefslogtreecommitdiff
path: root/spec/javascripts/monitoring/dashboard_spec.js
diff options
context:
space:
mode:
authorSimon Knox <psimyn@gmail.com>2019-02-04 10:50:04 +1100
committerSimon Knox <psimyn@gmail.com>2019-02-07 08:15:42 +1100
commitb1257951daf8b35b61781fb3317d8adfe0356adb (patch)
tree3f6653e92ff26ab43d89f3506a228276b03a2dd5 /spec/javascripts/monitoring/dashboard_spec.js
parent35bc3906d666d06d8230fe3d89b922c45d36a47d (diff)
downloadgitlab-ce-ee-8346-hide-unlicensed-alerts.tar.gz
Use ee_else_ce alias for monitoring_bundleee-8346-hide-unlicensed-alerts
Diffstat (limited to 'spec/javascripts/monitoring/dashboard_spec.js')
-rw-r--r--spec/javascripts/monitoring/dashboard_spec.js16
1 files changed, 7 insertions, 9 deletions
diff --git a/spec/javascripts/monitoring/dashboard_spec.js b/spec/javascripts/monitoring/dashboard_spec.js
index 97b9671c809..b1778029a77 100644
--- a/spec/javascripts/monitoring/dashboard_spec.js
+++ b/spec/javascripts/monitoring/dashboard_spec.js
@@ -25,15 +25,22 @@ export default propsData;
describe('Dashboard', () => {
let DashboardComponent;
+ let mock;
beforeEach(() => {
setFixtures(`
<div class="prometheus-graphs"></div>
<div class="layout-page"></div>
`);
+
+ mock = new MockAdapter(axios);
DashboardComponent = Vue.extend(Dashboard);
});
+ afterEach(() => {
+ mock.restore();
+ });
+
describe('no metrics are available yet', () => {
it('shows a getting started empty state when no metrics are present', () => {
const component = new DashboardComponent({
@@ -47,16 +54,10 @@ describe('Dashboard', () => {
});
describe('requests information to the server', () => {
- let mock;
beforeEach(() => {
- mock = new MockAdapter(axios);
mock.onGet(mockApiEndpoint).reply(200, metricsGroupsAPIResponse);
});
- afterEach(() => {
- mock.restore();
- });
-
it('shows up a loading state', done => {
const component = new DashboardComponent({
el: document.querySelector('.prometheus-graphs'),
@@ -152,15 +153,12 @@ describe('Dashboard', () => {
});
describe('when the window resizes', () => {
- let mock;
beforeEach(() => {
- mock = new MockAdapter(axios);
mock.onGet(mockApiEndpoint).reply(200, metricsGroupsAPIResponse);
jasmine.clock().install();
});
afterEach(() => {
- mock.restore();
jasmine.clock().uninstall();
});