2017-03-13 20:58:26 -04:00
|
|
|
import Vue from 'vue';
|
2017-04-20 05:04:06 -04:00
|
|
|
import stopComp from '~/environments/components/environment_stop.vue';
|
2016-12-29 16:42:48 -05:00
|
|
|
|
2016-11-10 13:58:35 -05:00
|
|
|
describe('Stop Component', () => {
|
2017-03-13 20:58:26 -04:00
|
|
|
let StopComponent;
|
2016-11-19 08:29:48 -05:00
|
|
|
let component;
|
2017-03-13 20:58:26 -04:00
|
|
|
const stopURL = '/stop';
|
2016-11-19 08:29:48 -05:00
|
|
|
|
2016-11-10 13:58:35 -05:00
|
|
|
beforeEach(() => {
|
2017-03-13 20:58:26 -04:00
|
|
|
StopComponent = Vue.extend(stopComp);
|
|
|
|
spyOn(window, 'confirm').and.returnValue(true);
|
2016-11-10 13:58:35 -05:00
|
|
|
|
2017-02-09 06:52:22 -05:00
|
|
|
component = new StopComponent({
|
2016-11-10 13:58:35 -05:00
|
|
|
propsData: {
|
2016-12-08 06:54:08 -05:00
|
|
|
stopUrl: stopURL,
|
2016-11-10 13:58:35 -05:00
|
|
|
},
|
2017-03-13 20:58:26 -04:00
|
|
|
}).$mount();
|
2016-11-10 13:58:35 -05:00
|
|
|
});
|
2016-11-19 08:07:13 -05:00
|
|
|
|
2017-06-06 16:46:31 -04:00
|
|
|
describe('computed', () => {
|
|
|
|
it('title', () => {
|
|
|
|
expect(component.title).toEqual('Stop');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2017-03-13 20:58:26 -04:00
|
|
|
it('should render a button to stop the environment', () => {
|
|
|
|
expect(component.$el.tagName).toEqual('BUTTON');
|
2017-06-06 16:46:31 -04:00
|
|
|
expect(component.$el.getAttribute('data-original-title')).toEqual('Stop');
|
|
|
|
expect(component.$el.getAttribute('aria-label')).toEqual('Stop');
|
2016-11-19 08:29:48 -05:00
|
|
|
});
|
2016-11-10 13:58:35 -05:00
|
|
|
});
|