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

36 lines
983 B
JavaScript
Raw Normal View History

2017-08-17 22:00:37 +05:30
import Vue from 'vue';
import rollbackComp from '~/environments/components/environment_rollback.vue';
describe('Rollback Component', () => {
const retryURL = 'https://gitlab.com/retry';
let RollbackComponent;
beforeEach(() => {
RollbackComponent = Vue.extend(rollbackComp);
});
it('Should render Re-deploy label when isLastDeployment is true', () => {
const component = new RollbackComponent({
el: document.querySelector('.test-dom-element'),
propsData: {
retryUrl: retryURL,
isLastDeployment: true,
},
}).$mount();
2018-11-18 11:00:15 +05:30
expect(component.$el).toHaveSpriteIcon('repeat');
2017-08-17 22:00:37 +05:30
});
it('Should render Rollback label when isLastDeployment is false', () => {
const component = new RollbackComponent({
el: document.querySelector('.test-dom-element'),
propsData: {
retryUrl: retryURL,
isLastDeployment: false,
},
}).$mount();
2018-11-18 11:00:15 +05:30
expect(component.$el).toHaveSpriteIcon('redo');
2017-08-17 22:00:37 +05:30
});
});