Commit cfa58afc authored by Rémy Coutable's avatar Rémy Coutable

Resolve conflict in spec/javascripts/environments/environment_table_spec.js

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent dd337389
import Vue from 'vue'; import Vue from 'vue';
import environmentTableComp from '~/environments/components/environments_table.vue'; import environmentTableComp from '~/environments/components/environments_table.vue';
<<<<<<< HEAD
import eventHub from '~/environments/event_hub'; import eventHub from '~/environments/event_hub';
import { deployBoardMockData } from './mock_data'; import { deployBoardMockData } from './mock_data';
describe('Environment item', () => {
let EnvironmentTable;
beforeEach(() => {
EnvironmentTable = Vue.extend(environmentTableComp);
=======
import mountComponent from '../helpers/vue_mount_component_helper'; import mountComponent from '../helpers/vue_mount_component_helper';
describe('Environment table', () => { describe('Environment table', () => {
...@@ -22,7 +14,6 @@ describe('Environment table', () => { ...@@ -22,7 +14,6 @@ describe('Environment table', () => {
afterEach(() => { afterEach(() => {
vm.$destroy(); vm.$destroy();
>>>>>>> ce/master
}); });
it('Should render a table', () => { it('Should render a table', () => {
...@@ -34,22 +25,11 @@ describe('Environment table', () => { ...@@ -34,22 +25,11 @@ describe('Environment table', () => {
environment_path: 'url', environment_path: 'url',
}; };
<<<<<<< HEAD
const component = new EnvironmentTable({
el: document.querySelector('.test-dom-element'),
propsData: {
environments: [mockItem],
canCreateDeployment: false,
canReadEnvironment: true,
},
}).$mount();
=======
vm = mountComponent(Component, { vm = mountComponent(Component, {
environments: [mockItem], environments: [mockItem],
canCreateDeployment: false, canCreateDeployment: false,
canReadEnvironment: true, canReadEnvironment: true,
}); });
>>>>>>> ce/master
expect(vm.$el.getAttribute('class')).toContain('ci-table'); expect(vm.$el.getAttribute('class')).toContain('ci-table');
}); });
...@@ -67,18 +47,15 @@ describe('Environment table', () => { ...@@ -67,18 +47,15 @@ describe('Environment table', () => {
isEmptyDeployBoard: false, isEmptyDeployBoard: false,
}; };
const component = new EnvironmentTable({ vm = mountComponent(Component, {
el: document.querySelector('.test-dom-element'), environments: [mockItem],
propsData: { canCreateDeployment: false,
environments: [mockItem], canReadEnvironment: true,
canCreateDeployment: true, });
canReadEnvironment: true,
},
}).$mount();
expect(component.$el.querySelector('.js-deploy-board-row')).toBeDefined(); expect(vm.$el.querySelector('.js-deploy-board-row')).toBeDefined();
expect( expect(
component.$el.querySelector('.deploy-board-icon i').classList.contains('fa-caret-right'), vm.$el.querySelector('.deploy-board-icon i').classList.contains('fa-caret-right'),
).toEqual(true); ).toEqual(true);
}); });
...@@ -105,15 +82,12 @@ describe('Environment table', () => { ...@@ -105,15 +82,12 @@ describe('Environment table', () => {
expect(env.id).toEqual(mockItem.id); expect(env.id).toEqual(mockItem.id);
}); });
const component = new EnvironmentTable({ vm = mountComponent(Component, {
el: document.querySelector('.test-dom-element'), environments: [mockItem],
propsData: { canCreateDeployment: false,
environments: [mockItem], canReadEnvironment: true,
canCreateDeployment: true, });
canReadEnvironment: true,
},
}).$mount();
component.$el.querySelector('.deploy-board-icon').click(); vm.$el.querySelector('.deploy-board-icon').click();
}); });
}); });
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment