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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

53 lines
1 KiB
JavaScript
Raw Normal View History

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