debian-mirror-gitlab/spec/frontend/notebook/cells/prompt_spec.js

57 lines
1.1 KiB
JavaScript
Raw Normal View History

2017-08-17 22:00:37 +05:30
import Vue from 'vue';
import PromptComponent from '~/notebook/cells/prompt.vue';
const Component = Vue.extend(PromptComponent);
describe('Prompt component', () => {
let vm;
describe('input', () => {
2018-12-13 13:39:08 +05:30
beforeEach(done => {
2017-08-17 22:00:37 +05:30
vm = new Component({
propsData: {
type: 'In',
count: 1,
},
});
vm.$mount();
2020-05-24 23:13:21 +05:30
setImmediate(() => {
2017-08-17 22:00:37 +05:30
done();
});
});
it('renders in label', () => {
expect(vm.$el.textContent.trim()).toContain('In');
});
it('renders count', () => {
expect(vm.$el.textContent.trim()).toContain('1');
});
});
describe('output', () => {
2018-12-13 13:39:08 +05:30
beforeEach(done => {
2017-08-17 22:00:37 +05:30
vm = new Component({
propsData: {
type: 'Out',
count: 1,
},
});
vm.$mount();
2020-05-24 23:13:21 +05:30
setImmediate(() => {
2017-08-17 22:00:37 +05:30
done();
});
});
it('renders in label', () => {
expect(vm.$el.textContent.trim()).toContain('Out');
});
it('renders count', () => {
expect(vm.$el.textContent.trim()).toContain('1');
});
});
});