diff options
author | Winnie Hellmann <winnie@gitlab.com> | 2018-12-10 12:09:22 +0100 |
---|---|---|
committer | Winnie Hellmann <winnie@gitlab.com> | 2018-12-11 15:03:59 +0100 |
commit | d0d776b69de39dee4fc824178ecf8f0ac289c82d (patch) | |
tree | fb6a71e90ccd02a8e7ba31019fa13d6927744b6a /spec/frontend | |
parent | 4b3573f2e9a2b5bc690597845e05819f224b7d4c (diff) | |
download | gitlab-ce-d0d776b69de39dee4fc824178ecf8f0ac289c82d.tar.gz |
Move timeline_entry_item_spec.js to Jest
Diffstat (limited to 'spec/frontend')
-rw-r--r-- | spec/frontend/vue_shared/components/notes/timeline_entry_item_spec.js | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/spec/frontend/vue_shared/components/notes/timeline_entry_item_spec.js b/spec/frontend/vue_shared/components/notes/timeline_entry_item_spec.js new file mode 100644 index 00000000000..c15635f2105 --- /dev/null +++ b/spec/frontend/vue_shared/components/notes/timeline_entry_item_spec.js @@ -0,0 +1,40 @@ +import { shallowMount, createLocalVue } from '@vue/test-utils'; +import TimelineEntryItem from '~/vue_shared/components/notes/timeline_entry_item.vue'; + +describe(TimelineEntryItem.name, () => { + let wrapper; + + const factory = (options = {}) => { + const localVue = createLocalVue(); + + wrapper = shallowMount(TimelineEntryItem, { + localVue, + ...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); + }); +}); |