BigW Consortium Gitlab

Fix karma repo_file_buttons_spec and repo_commit_section_spec

parent 8a6d236d
......@@ -6,21 +6,25 @@ import Api from '~/api';
describe('RepoCommitSection', () => {
const branch = 'master';
const projectUrl = 'projectUrl';
const openedFiles = [{
id: 0,
changed: true,
url: `${branch}/url0`,
url: `/namespace/${projectUrl}/blob/${branch}/dir/file0.ext`,
newContent: 'a',
}, {
id: 1,
changed: true,
url: `${branch}/url1`,
url: `/namespace/${projectUrl}/blob/${branch}/dir/file1.ext`,
newContent: 'b',
}, {
id: 2,
url: `/namespace/${projectUrl}/blob/${branch}/dir/file2.ext`,
changed: false,
}];
RepoStore.projectUrl = projectUrl;
function createComponent() {
const RepoCommitSection = Vue.extend(repoCommitSection);
......
......@@ -30,7 +30,6 @@ describe('RepoFileButtons', () => {
const history = vm.$el.querySelector('.history');
expect(vm.$el.id).toEqual('repo-file-buttons');
expect(vm.$el.style.borderBottom).toEqual('1px solid rgb(31, 120, 209)');
expect(raw.href).toMatch(`/${activeFile.raw_path}`);
expect(raw.textContent).toEqual('Raw');
expect(blame.href).toMatch(`/${activeFile.blame_path}`);
......@@ -41,20 +40,6 @@ describe('RepoFileButtons', () => {
expect(vm.$el.querySelector('.preview').textContent).toEqual(activeFileLabel);
});
it('renders a white border if not editMode', () => {
const activeFile = {
extension: 'md',
url: 'url',
};
RepoStore.openedFiles = new Array(1);
RepoStore.activeFile = activeFile;
RepoStore.editMode = false;
const vm = createComponent();
expect(vm.$el.style.borderBottom).toEqual('1px solid rgb(240, 240, 240)');
});
it('triggers rawPreviewToggle on preview click', () => {
const activeFile = {
extension: 'md',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment