Welcome to mirror list, hosted at ThFree Co, Russian Federation.

timeline_entry_item_spec.js « notes « components « vue_shared « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f73d3edec5d7973c4308bdbd01147b5bade38591 (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
37
import { shallowMount } from '@vue/test-utils';
import TimelineEntryItem from '~/vue_shared/components/notes/timeline_entry_item.vue';

describe(`TimelineEntryItem`, () => {
  let wrapper;

  const factory = (options = {}) => {
    wrapper = shallowMount(TimelineEntryItem, {
      ...options,
    });
  };

  afterEach(() => {
    wrapper.destroy();
  });

  it('renders correctly', () => {
    factory();

    expect(wrapper.is('.timeline-entry')).toBe(true);

    expect(wrapper.contains('.timeline-entry-inner')).toBe(true);
  });

  it('accepts default slot', () => {
    const dummyContent = '<p>some content</p>';
    factory({
      slots: {
        default: dummyContent,
      },
    });

    const content = wrapper.find('.timeline-entry-inner :first-child');

    expect(content.html()).toBe(dummyContent);
  });
});