summaryrefslogtreecommitdiff
path: root/spec/javascripts/environments/environment_stop_spec.js.es6
blob: 2dfce5ba824bb0f461ead921c8fe36411213b471 (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
require('~/environments/components/environment_stop');

describe('Stop Component', () => {
  preloadFixtures('static/environments/element.html.raw');

  let stopURL;
  let component;

  beforeEach(() => {
    loadFixtures('static/environments/element.html.raw');

    stopURL = '/stop';
    component = new window.gl.environmentsList.StopComponent({
      el: document.querySelector('.test-dom-element'),
      propsData: {
        stopUrl: stopURL,
      },
    });
  });

  it('should link to the provided URL', () => {
    expect(component.$el.getAttribute('href')).toEqual(stopURL);
  });

  it('should have a data-confirm attribute', () => {
    expect(component.$el.getAttribute('data-confirm')).toEqual('Are you sure you want to stop this environment?');
  });
});