summaryrefslogtreecommitdiff
path: root/spec/javascripts/environments/environment_external_url_spec.js.es6
blob: 156506ef28f24eb40901b4da73f9a81012742f8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//= require vue
//= require environments/components/environment_external_url

describe('External URL Component', () => {
  fixture.preload('environments/element.html');
  beforeEach(() => {
    fixture.load('environments/element.html');
  });

  it('should link to the provided external_url', () => {
    const externalURL = 'https://gitlab.com';
    const component = new window.gl.environmentsList.ExternalUrlComponent({
      el: document.querySelector('.test-dom-element'),
      propsData: {
        external_url: externalURL,
      },
    });

    expect(component.$el.getAttribute('href')).toEqual(externalURL);
    expect(component.$el.querySelector('fa-external-link')).toBeDefined();
  });
});