import Vue from 'vue';
import repoFileOptions from '~/repo/components/repo_file_options.vue';

describe('RepoFileOptions', () => {
  const projectName = 'projectName';

  function createComponent(propsData) {
    const RepoFileOptions = Vue.extend(repoFileOptions);

    return new RepoFileOptions({
      propsData,
    }).$mount();
  }

  it('renders the title and new file/folder buttons if isMini is true', () => {
    const vm = createComponent({
      isMini: true,
      projectName,
    });

    expect(vm.$el.classList.contains('repo-file-options')).toBeTruthy();
    expect(vm.$el.querySelector('.title').textContent).toEqual(projectName);
    expect(vm.$el.querySelector('a[title="New File"]')).toBeTruthy();
    expect(vm.$el.querySelector('a[title="New Folder"]')).toBeTruthy();
  });

  it('does not render if isMini is false', () => {
    const vm = createComponent({
      isMini: false,
      projectName,
    });

    expect(vm.$el.innerHTML).toBeFalsy();
  });
});

@@ -647,150 +647,8 @@
 e);%0A
-    expect(vm.$el.querySelector('a%5Btitle=%22New File%22%5D')).toBeTruthy();%0A    expect(vm.$el.querySelector('a%5Btitle=%22New Folder%22%5D')).toBeTruthy();%0A
   %7D)

Fix repo_file_options_spec