Commit 6e519607 authored by Fatih Acet's avatar Fatih Acet

Merge branch 'ee-8346-hide-unlicensed-alerts' into 'master'

Backport to resolve conflicts for gitlab-ee!9224

See merge request gitlab-org/gitlab-ce!24889
parents 81597427 b1257951
...@@ -160,7 +160,8 @@ export default { ...@@ -160,7 +160,8 @@ export default {
{{ s__('Metrics|Environment') }} {{ s__('Metrics|Environment') }}
<div class="dropdown prepend-left-10"> <div class="dropdown prepend-left-10">
<button class="dropdown-menu-toggle" data-toggle="dropdown" type="button"> <button class="dropdown-menu-toggle" data-toggle="dropdown" type="button">
<span> {{ currentEnvironmentName }} </span> <icon name="chevron-down" /> <span>{{ currentEnvironmentName }}</span>
<icon name="chevron-down" />
</button> </button>
<div <div
v-if="store.environmentsData.length > 0" v-if="store.environmentsData.length > 0"
...@@ -172,9 +173,8 @@ export default { ...@@ -172,9 +173,8 @@ export default {
:href="environment.metrics_path" :href="environment.metrics_path"
:class="{ 'is-active': environment.name == currentEnvironmentName }" :class="{ 'is-active': environment.name == currentEnvironmentName }"
class="dropdown-item" class="dropdown-item"
>{{ environment.name }}</a
> >
{{ environment.name }}
</a>
</li> </li>
</ul> </ul>
</div> </div>
......
import monitoringBundle from '~/monitoring/monitoring_bundle'; import monitoringBundle from 'ee_else_ce/monitoring/monitoring_bundle';
document.addEventListener('DOMContentLoaded', monitoringBundle); document.addEventListener('DOMContentLoaded', monitoringBundle);
...@@ -25,15 +25,22 @@ export default propsData; ...@@ -25,15 +25,22 @@ export default propsData;
describe('Dashboard', () => { describe('Dashboard', () => {
let DashboardComponent; let DashboardComponent;
let mock;
beforeEach(() => { beforeEach(() => {
setFixtures(` setFixtures(`
<div class="prometheus-graphs"></div> <div class="prometheus-graphs"></div>
<div class="layout-page"></div> <div class="layout-page"></div>
`); `);
mock = new MockAdapter(axios);
DashboardComponent = Vue.extend(Dashboard); DashboardComponent = Vue.extend(Dashboard);
}); });
afterEach(() => {
mock.restore();
});
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({
...@@ -47,16 +54,10 @@ describe('Dashboard', () => { ...@@ -47,16 +54,10 @@ describe('Dashboard', () => {
}); });
describe('requests information to the server', () => { describe('requests information to the server', () => {
let mock;
beforeEach(() => { beforeEach(() => {
mock = new MockAdapter(axios);
mock.onGet(mockApiEndpoint).reply(200, metricsGroupsAPIResponse); mock.onGet(mockApiEndpoint).reply(200, metricsGroupsAPIResponse);
}); });
afterEach(() => {
mock.restore();
});
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'),
...@@ -152,15 +153,12 @@ describe('Dashboard', () => { ...@@ -152,15 +153,12 @@ describe('Dashboard', () => {
}); });
describe('when the window resizes', () => { describe('when the window resizes', () => {
let mock;
beforeEach(() => { beforeEach(() => {
mock = new MockAdapter(axios);
mock.onGet(mockApiEndpoint).reply(200, metricsGroupsAPIResponse); mock.onGet(mockApiEndpoint).reply(200, metricsGroupsAPIResponse);
jasmine.clock().install(); jasmine.clock().install();
}); });
afterEach(() => { afterEach(() => {
mock.restore();
jasmine.clock().uninstall(); jasmine.clock().uninstall();
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment