debian-mirror-gitlab/spec/javascripts/environments/environment_table_spec.js

36 lines
773 B
JavaScript
Raw Normal View History

2017-08-17 22:00:37 +05:30
import Vue from 'vue';
import environmentTableComp from '~/environments/components/environments_table.vue';
2018-03-27 19:54:05 +05:30
import mountComponent from 'spec/helpers/vue_mount_component_helper';
2018-03-17 18:26:18 +05:30
describe('Environment table', () => {
let Component;
let vm;
2017-08-17 22:00:37 +05:30
beforeEach(() => {
2018-03-17 18:26:18 +05:30
Component = Vue.extend(environmentTableComp);
});
afterEach(() => {
vm.$destroy();
2017-08-17 22:00:37 +05:30
});
it('Should render a table', () => {
const mockItem = {
name: 'review',
size: 3,
isFolder: true,
latest: {
environment_path: 'url',
},
};
2018-03-17 18:26:18 +05:30
vm = mountComponent(Component, {
environments: [mockItem],
canCreateDeployment: false,
canReadEnvironment: true,
});
2017-08-17 22:00:37 +05:30
2018-03-17 18:26:18 +05:30
expect(vm.$el.getAttribute('class')).toContain('ci-table');
2017-08-17 22:00:37 +05:30
});
});