gitlab-org--gitlab-foss/spec/javascripts/diffs/components/diff_discussions_spec.js

25 lines
801 B
JavaScript
Raw Normal View History

2018-06-21 08:22:40 -04:00
import Vue from 'vue';
import DiffDiscussions from '~/diffs/components/diff_discussions.vue';
import store from '~/mr_notes/stores';
import { createComponentWithStore } from 'spec/helpers/vue_mount_component_helper';
import discussionsMockData from '../mock_data/diff_discussions';
describe('DiffDiscussions', () => {
let component;
const getDiscussionsMockData = () => [Object.assign({}, discussionsMockData)];
beforeEach(() => {
component = createComponentWithStore(Vue.extend(DiffDiscussions), store, {
discussions: getDiscussionsMockData(),
}).$mount();
});
describe('template', () => {
it('should have notes list', () => {
const { $el } = component;
expect($el.querySelectorAll('.discussion .note.timeline-entry').length).toEqual(5);
});
});
});