summaryrefslogtreecommitdiff
path: root/spec/javascripts/environments/environment_table_spec.js
blob: be4330b50124a9e87ae16fa871ef4f8728d85b89 (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
const EnvironmentTable = require('~/environments/components/environments_table');

describe('Environment item', () => {
  preloadFixtures('static/environments/element.html.raw');
  beforeEach(() => {
    loadFixtures('static/environments/element.html.raw');
  });

  it('Should render a table', () => {
    const mockItem = {
      name: 'review',
      size: 3,
      isFolder: true,
      latest: {
        environment_path: 'url',
      },
    };

    const component = new EnvironmentTable({
      el: document.querySelector('.test-dom-element'),
      propsData: {
        environments: [{ mockItem }],
        canCreateDeployment: false,
        canReadEnvironment: true,
      },
    });

    expect(component.$el.tagName).toEqual('TABLE');
  });
});