BigW Consortium Gitlab

environment_table_spec.js 897 Bytes
Newer Older
1
import Vue from 'vue';
2
import environmentTableComp from '~/environments/components/environments_table.vue';
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

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',
      },
    };

20 21
    const EnvironmentTable = Vue.extend(environmentTableComp);

22 23 24 25 26 27
    const component = new EnvironmentTable({
      el: document.querySelector('.test-dom-element'),
      propsData: {
        environments: [{ mockItem }],
        canCreateDeployment: false,
        canReadEnvironment: true,
28
        service: {},
29
      },
30
    }).$mount();
31

32
    expect(component.$el.getAttribute('class')).toContain('ci-table');
33 34
  });
});