summaryrefslogtreecommitdiff
path: root/spec/frontend/notebook/cells/prompt_spec.js
blob: 4c864a9b93017f6d2f62956ab65bd479e7334605 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { shallowMount } from '@vue/test-utils';
import Prompt from '~/notebook/cells/prompt.vue';

describe('Prompt component', () => {
  let wrapper;

  const mountComponent = ({ type }) => shallowMount(Prompt, { propsData: { type, count: 1 } });

  describe('input', () => {
    beforeEach(() => {
      wrapper = mountComponent({ type: 'In' });
    });

    it('renders in label', () => {
      expect(wrapper.text()).toContain('In');
    });

    it('renders count', () => {
      expect(wrapper.text()).toContain('1');
    });
  });

  describe('output', () => {
    beforeEach(() => {
      wrapper = mountComponent({ type: 'Out' });
    });

    it('renders in label', () => {
      expect(wrapper.text()).toContain('Out');
    });

    it('renders count', () => {
      expect(wrapper.text()).toContain('1');
    });
  });
});