{"size": 1650, "ext": "js", "max_stars_repo_path": "sashimi-webapp/test/unit/specs/ui/Content.spec.js", "max_stars_repo_name": "nus-mtp/sashimi-note", "max_stars_repo_stars_event_min_datetime": "2017-03-22T12:07:30.000Z", "max_stars_repo_stars_event_max_datetime": "2021-08-06T10:53:12.000Z", "max_issues_repo_path": "sashimi-webapp/test/unit/specs/ui/Content.spec.js", "max_issues_repo_name": "nus-mtp/lecture-note-2.0", "max_issues_repo_issues_event_min_datetime": "2017-01-26T06:26:13.000Z", "max_issues_repo_issues_event_max_datetime": "2017-03-20T04:24:35.000Z", "max_forks_repo_path": "sashimi-webapp/test/unit/specs/ui/Content.spec.js", "max_forks_repo_name": "nus-mtp/lecture-note-2.0", "max_forks_repo_forks_event_min_datetime": "2018-04-09T13:18:10.000Z", "max_forks_repo_forks_event_max_datetime": "2018-04-09T13:18:10.000Z"}
{"max_stars_count": 6, "max_issues_count": 245, "max_forks_count": 1, "avg_line_length": 33.0, "max_line_length": 64, "alphanum_fraction": 0.6466666667}
import Vue from 'vue';
import Content from 'src/components/editor-viewer/Content';

const VIEWER_CONTAINER_ID = 'viewer-container';

const mockContainer = document.createElement('DIV');
mockContainer.setAttribute('id', VIEWER_CONTAINER_ID);
document.body.appendChild(mockContainer);

describe('Content.vue', () => {
  // A mock viewer-container DOM is needed for this test.
  // It will be created before all the test are ran, and remove
  // when all the tests are finished.
  const Constructor = Vue.extend(Content);
  const vm = new Constructor().$mount();

  it('should render Navbar component', () => {
    expect(vm.$el.querySelector('.navbar'))
      .to.not.equal(null);
  });
  it('should render toggle edit button', () => {
    expect(vm.$el.querySelector('.navbar #button-editor'))
      .to.not.equal(null);
  });
  it('should render toggle viewer button', () => {
    expect(vm.$el.querySelector('.navbar #button-viewer'))
      .to.not.equal(null);
  });
  it('should render toggle split screen button', () => {
    expect(vm.$el.querySelector('.navbar #button-split-screen'))
      .to.not.equal(null);
  });
  it('should render Editor wrapper', () => {
    expect(vm.$el.querySelector('.editor-wrapper'))
      .to.not.equal(null);
  });
  it('should render Viewer wrapper', () => {
    expect(vm.$el.querySelector('.viewer-wrapper'))
      .to.not.equal(null);
  });
  it('should render Editor component', () => {
    expect(vm.$el.querySelector('.group .editor'))
      .to.not.equal(null);
  });
  it('should render Viewer component', () => {
    expect(vm.$el.querySelector('.group .viewer'))
      .to.not.equal(null);
  });
});
