Commit f2b6ac83 authored by Filipa Lacerda's avatar Filipa Lacerda

Fix broken tests

parent f047c4f8
const Vue = require('vue');
const DeployBoardComponent = require('~/environments/components/deploy_board_component');
const DeployBoard = require('~/environments/components/deploy_board_component');
const Service = require('~/environments/services/environments_service');
const { deployBoardMockData } = require('./mock_data');
describe('Deploy Board', () => {
preloadFixtures('static/environments/element.html.raw');
let DeployBoardComponent;
beforeEach(() => {
loadFixtures('static/environments/element.html.raw');
DeployBoardComponent = Vue.extend(DeployBoard);
});
describe('successfull request', () => {
......@@ -25,14 +25,13 @@ describe('Deploy Board', () => {
this.service = new Service('environments');
component = new DeployBoardComponent({
el: document.querySelector('.test-dom-element'),
propsData: {
store: {},
service: this.service,
deployBoardData: deployBoardMockData,
environmentID: 1,
},
});
}).$mount();
});
afterEach(() => {
......@@ -92,14 +91,13 @@ describe('Deploy Board', () => {
this.service = new Service('environments');
component = new DeployBoardComponent({
el: document.querySelector('.test-dom-element'),
propsData: {
store: {},
service: this.service,
deployBoardData: {},
environmentID: 1,
},
});
}).$mount();
});
afterEach(() => {
......
require('vue');
const DeployBoardInstanceComponent = require('~/environments/components/deploy_board_instance_component');
const Vue = require('vue');
const DeployBoardInstance = require('~/environments/components/deploy_board_instance_component');
describe('Deploy Board Instance', () => {
preloadFixtures('static/environments/element.html.raw');
let DeployBoardInstanceComponent;
beforeEach(() => {
loadFixtures('static/environments/element.html.raw');
DeployBoardInstanceComponent = Vue.extend(DeployBoardInstance);
});
it('should render a div with the correct css status and tooltip data', () => {
const component = new DeployBoardInstanceComponent({
el: document.querySelector('.test-dom-element'),
propsData: {
status: 'ready',
tooltipText: 'This is a pod',
},
});
}).$mount();
expect(component.$el.classList.contains('deploy-board-instance-ready')).toBe(true);
expect(component.$el.getAttribute('data-title')).toEqual('This is a pod');
......@@ -23,11 +22,10 @@ describe('Deploy Board Instance', () => {
it('should render a div without tooltip data', () => {
const component = new DeployBoardInstanceComponent({
el: document.querySelector('.test-dom-element'),
propsData: {
status: 'deploying',
},
});
}).$mount();
expect(component.$el.classList.contains('deploy-board-instance-deploying')).toBe(true);
expect(component.$el.getAttribute('data-title')).toEqual('');
......
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