debian-mirror-gitlab/spec/javascripts/environments/environment_terminal_button_spec.js

32 lines
895 B
JavaScript
Raw Normal View History

2017-08-17 22:00:37 +05:30
import Vue from 'vue';
import terminalComp from '~/environments/components/environment_terminal_button.vue';
describe('Stop Component', () => {
let TerminalComponent;
let component;
const terminalPath = '/path';
beforeEach(() => {
TerminalComponent = Vue.extend(terminalComp);
component = new TerminalComponent({
propsData: {
terminalPath,
},
}).$mount();
});
2017-09-10 17:25:29 +05:30
describe('computed', () => {
it('title', () => {
expect(component.title).toEqual('Terminal');
});
});
2017-08-17 22:00:37 +05:30
it('should render a link to open a web terminal with the provided path', () => {
expect(component.$el.tagName).toEqual('A');
2017-09-10 17:25:29 +05:30
expect(component.$el.getAttribute('data-original-title')).toEqual('Terminal');
expect(component.$el.getAttribute('aria-label')).toEqual('Terminal');
2017-08-17 22:00:37 +05:30
expect(component.$el.getAttribute('href')).toEqual(terminalPath);
});
});