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

36 lines
771 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-17 18:26:18 +05:30
import mountComponent from '../helpers/vue_mount_component_helper';
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
});
});