gitlab-org--gitlab-foss/spec/javascripts/environments/environment_table_spec.js

36 lines
773 B
JavaScript
Raw Normal View History

import Vue from 'vue';
import environmentTableComp from '~/environments/components/environments_table.vue';
import mountComponent from 'spec/helpers/vue_mount_component_helper';
2017-11-23 07:04:03 -05:00
describe('Environment table', () => {
let Component;
let vm;
beforeEach(() => {
2017-11-23 07:04:03 -05:00
Component = Vue.extend(environmentTableComp);
});
afterEach(() => {
vm.$destroy();
});
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-11-23 07:04:03 -05:00
expect(vm.$el.getAttribute('class')).toContain('ci-table');
});
});