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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWinnie Hellmann <winnie@gitlab.com>2018-12-10 14:09:22 +0300
committerWinnie Hellmann <winnie@gitlab.com>2018-12-11 17:03:59 +0300
commitd0d776b69de39dee4fc824178ecf8f0ac289c82d (patch)
treefb6a71e90ccd02a8e7ba31019fa13d6927744b6a /spec/frontend/vue_shared/components/notes
parent4b3573f2e9a2b5bc690597845e05819f224b7d4c (diff)
Move timeline_entry_item_spec.js to Jest
Diffstat (limited to 'spec/frontend/vue_shared/components/notes')
-rw-r--r--spec/frontend/vue_shared/components/notes/timeline_entry_item_spec.js40
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);
+ });
+});