2017-03-31 05:20:11 -04:00
|
|
|
import Vue from 'vue';
|
2017-04-20 07:48:54 -04:00
|
|
|
import monitoringComp from '~/environments/components/environment_monitoring.vue';
|
2017-03-31 05:20:11 -04:00
|
|
|
|
|
|
|
describe('Monitoring Component', () => {
|
|
|
|
let MonitoringComponent;
|
2017-06-06 16:46:31 -04:00
|
|
|
let component;
|
|
|
|
|
|
|
|
const monitoringUrl = 'https://gitlab.com';
|
2017-03-31 05:20:11 -04:00
|
|
|
|
|
|
|
beforeEach(() => {
|
|
|
|
MonitoringComponent = Vue.extend(monitoringComp);
|
|
|
|
|
2017-06-06 16:46:31 -04:00
|
|
|
component = new MonitoringComponent({
|
2017-03-31 05:20:11 -04:00
|
|
|
propsData: {
|
|
|
|
monitoringUrl,
|
|
|
|
},
|
|
|
|
}).$mount();
|
2017-06-06 16:46:31 -04:00
|
|
|
});
|
2017-03-31 05:20:11 -04:00
|
|
|
|
2017-06-06 16:46:31 -04:00
|
|
|
describe('computed', () => {
|
|
|
|
it('title', () => {
|
|
|
|
expect(component.title).toEqual('Monitoring');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should render a link to environment monitoring page', () => {
|
2017-03-31 05:20:11 -04:00
|
|
|
expect(component.$el.getAttribute('href')).toEqual(monitoringUrl);
|
|
|
|
expect(component.$el.querySelector('.fa-area-chart')).toBeDefined();
|
2017-06-06 16:46:31 -04:00
|
|
|
expect(component.$el.getAttribute('data-original-title')).toEqual('Monitoring');
|
|
|
|
expect(component.$el.getAttribute('aria-label')).toEqual('Monitoring');
|
2017-03-31 05:20:11 -04:00
|
|
|
});
|
|
|
|
});
|