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

41 lines
885 B
JavaScript
Raw Normal View History

2022-08-13 15:12:31 +05:30
import { shallowMount } from '@vue/test-utils';
import Prompt from '~/notebook/cells/prompt.vue';
2017-08-17 22:00:37 +05:30
describe('Prompt component', () => {
2022-08-13 15:12:31 +05:30
let wrapper;
const mountComponent = ({ type }) => shallowMount(Prompt, { propsData: { type, count: 1 } });
afterEach(() => {
wrapper.destroy();
});
2017-08-17 22:00:37 +05:30
describe('input', () => {
2022-04-04 11:22:00 +05:30
beforeEach(() => {
2022-08-13 15:12:31 +05:30
wrapper = mountComponent({ type: 'In' });
2017-08-17 22:00:37 +05:30
});
it('renders in label', () => {
2022-08-13 15:12:31 +05:30
expect(wrapper.text()).toContain('In');
2017-08-17 22:00:37 +05:30
});
it('renders count', () => {
2022-08-13 15:12:31 +05:30
expect(wrapper.text()).toContain('1');
2017-08-17 22:00:37 +05:30
});
});
describe('output', () => {
2022-04-04 11:22:00 +05:30
beforeEach(() => {
2022-08-13 15:12:31 +05:30
wrapper = mountComponent({ type: 'Out' });
2017-08-17 22:00:37 +05:30
});
it('renders in label', () => {
2022-08-13 15:12:31 +05:30
expect(wrapper.text()).toContain('Out');
2017-08-17 22:00:37 +05:30
});
it('renders count', () => {
2022-08-13 15:12:31 +05:30
expect(wrapper.text()).toContain('1');
2017-08-17 22:00:37 +05:30
});
});
});