summaryrefslogtreecommitdiff
path: root/spec/javascripts/environments/environment_terminal_button_spec.js
blob: f1576b19d1bf59341267a70d689acdff204394e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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();
  });

  describe('computed', () => {
    it('title', () => {
      expect(component.title).toEqual('Terminal');
    });
  });

  it('should render a link to open a web terminal with the provided path', () => {
    expect(component.$el.tagName).toEqual('A');
    expect(component.$el.getAttribute('data-original-title')).toEqual('Terminal');
    expect(component.$el.getAttribute('aria-label')).toEqual('Terminal');
    expect(component.$el.getAttribute('href')).toEqual(terminalPath);
  });
});