2017-03-20 11:36:02 -04:00
|
|
|
import Vue from 'vue';
|
2017-04-19 07:44:37 -04:00
|
|
|
import emptyStateComp from '~/pipelines/components/empty_state.vue';
|
2017-03-20 11:36:02 -04:00
|
|
|
|
|
|
|
describe('Pipelines Empty State', () => {
|
|
|
|
let component;
|
|
|
|
let EmptyStateComponent;
|
|
|
|
|
|
|
|
beforeEach(() => {
|
|
|
|
EmptyStateComponent = Vue.extend(emptyStateComp);
|
|
|
|
|
|
|
|
component = new EmptyStateComponent({
|
|
|
|
propsData: {
|
|
|
|
helpPagePath: 'foo',
|
2017-09-22 04:39:47 -04:00
|
|
|
emptyStateSvgPath: 'foo',
|
2017-03-20 11:36:02 -04:00
|
|
|
},
|
|
|
|
}).$mount();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should render empty state SVG', () => {
|
|
|
|
expect(component.$el.querySelector('.svg-content svg')).toBeDefined();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should render emtpy state information', () => {
|
|
|
|
expect(component.$el.querySelector('h4').textContent).toContain('Build with confidence');
|
|
|
|
|
|
|
|
expect(
|
2018-01-09 06:58:34 -05:00
|
|
|
component.$el.querySelector('p').textContent.trim().replace(/[\r\n]+/g, ' '),
|
2017-03-20 11:36:02 -04:00
|
|
|
).toContain('Continous Integration can help catch bugs by running your tests automatically');
|
|
|
|
|
|
|
|
expect(
|
2018-01-09 06:58:34 -05:00
|
|
|
component.$el.querySelector('p').textContent.trim().replace(/[\r\n]+/g, ' '),
|
2017-03-20 11:36:02 -04:00
|
|
|
).toContain('Continuous Deployment can help you deliver code to your product environment');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should render a link with provided help path', () => {
|
|
|
|
expect(component.$el.querySelector('.btn-info').getAttribute('href')).toEqual('foo');
|
|
|
|
expect(component.$el.querySelector('.btn-info').textContent).toContain('Get started with Pipelines');
|
|
|
|
});
|
|
|
|
});
|