2017-08-17 22:00:37 +05:30
|
|
|
import Vue from 'vue';
|
|
|
|
import monitoringComp from '~/environments/components/environment_monitoring.vue';
|
|
|
|
|
|
|
|
describe('Monitoring Component', () => {
|
|
|
|
let MonitoringComponent;
|
2017-09-10 17:25:29 +05:30
|
|
|
let component;
|
|
|
|
|
|
|
|
const monitoringUrl = 'https://gitlab.com';
|
2017-08-17 22:00:37 +05:30
|
|
|
|
|
|
|
beforeEach(() => {
|
|
|
|
MonitoringComponent = Vue.extend(monitoringComp);
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
component = new MonitoringComponent({
|
2017-08-17 22:00:37 +05:30
|
|
|
propsData: {
|
|
|
|
monitoringUrl,
|
|
|
|
},
|
|
|
|
}).$mount();
|
2017-09-10 17:25:29 +05:30
|
|
|
});
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
describe('computed', () => {
|
|
|
|
it('title', () => {
|
|
|
|
expect(component.title).toEqual('Monitoring');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should render a link to environment monitoring page', () => {
|
2017-08-17 22:00:37 +05:30
|
|
|
expect(component.$el.getAttribute('href')).toEqual(monitoringUrl);
|
|
|
|
expect(component.$el.querySelector('.fa-area-chart')).toBeDefined();
|
2017-09-10 17:25:29 +05:30
|
|
|
expect(component.$el.getAttribute('data-original-title')).toEqual('Monitoring');
|
|
|
|
expect(component.$el.getAttribute('aria-label')).toEqual('Monitoring');
|
2017-08-17 22:00:37 +05:30
|
|
|
});
|
|
|
|
});
|