2017-03-13 20:58:26 -04:00
|
|
|
import Vue from 'vue';
|
2017-04-21 11:16:22 -04:00
|
|
|
import environmentTableComp from '~/environments/components/environments_table.vue';
|
2018-02-26 14:43:34 -05:00
|
|
|
import mountComponent from 'spec/helpers/vue_mount_component_helper';
|
2017-11-23 07:04:03 -05:00
|
|
|
|
|
|
|
describe('Environment table', () => {
|
|
|
|
let Component;
|
|
|
|
let vm;
|
2017-02-13 11:11:11 -05:00
|
|
|
|
|
|
|
beforeEach(() => {
|
2017-11-23 07:04:03 -05:00
|
|
|
Component = Vue.extend(environmentTableComp);
|
|
|
|
});
|
|
|
|
|
|
|
|
afterEach(() => {
|
|
|
|
vm.$destroy();
|
2017-02-13 11:11:11 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
it('Should render a table', () => {
|
|
|
|
const mockItem = {
|
|
|
|
name: 'review',
|
|
|
|
size: 3,
|
|
|
|
isFolder: true,
|
|
|
|
latest: {
|
|
|
|
environment_path: 'url',
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2017-11-23 07:04:03 -05:00
|
|
|
vm = mountComponent(Component, {
|
|
|
|
environments: [mockItem],
|
|
|
|
canCreateDeployment: false,
|
|
|
|
canReadEnvironment: true,
|
|
|
|
});
|
2017-02-13 11:11:11 -05:00
|
|
|
|
2017-11-23 07:04:03 -05:00
|
|
|
expect(vm.$el.getAttribute('class')).toContain('ci-table');
|
2017-02-13 11:11:11 -05:00
|
|
|
});
|
|
|
|
});
|