summaryrefslogtreecommitdiff
path: root/spec/javascripts/environments/environment_stop_spec.js
blob: 4d9caa575666338bfc8ffa9771404ae04c958a2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import Vue from 'vue';
import stopComp from '~/environments/components/environment_stop.vue';

describe('Stop Component', () => {
  let StopComponent;
  let component;

  beforeEach(() => {
    StopComponent = Vue.extend(stopComp);
    spyOn(window, 'confirm').and.returnValue(true);

    component = new StopComponent({
      propsData: {
        environment: {},
      },
    }).$mount();
  });

  it('should render a button to stop the environment', () => {
    expect(component.$el.tagName).toEqual('BUTTON');
    expect(component.$el.getAttribute('data-original-title')).toEqual('Stop environment');
  });
});