Welcome to mirror list, hosted at ThFree Co, Russian Federation.

environment_table_spec.js « environments « javascripts « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: effbc6c3ee1d9dd15a04ee02717fcfc2d04db82a (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
31
32
33
34
import Vue from 'vue';
import environmentTableComp from '~/environments/components/environments_table.vue';

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 EnvironmentTable = Vue.extend(environmentTableComp);

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

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