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