Commit 3f15afbe authored by Luke "Jared" Bennett's avatar Luke "Jared" Bennett

Fix karma repo_file_buttons_spec and repo_commit_section_spec

parent 8a6d236d
...@@ -6,21 +6,25 @@ import Api from '~/api'; ...@@ -6,21 +6,25 @@ import Api from '~/api';
describe('RepoCommitSection', () => { describe('RepoCommitSection', () => {
const branch = 'master'; const branch = 'master';
const projectUrl = 'projectUrl';
const openedFiles = [{ const openedFiles = [{
id: 0, id: 0,
changed: true, changed: true,
url: `${branch}/url0`, url: `/namespace/${projectUrl}/blob/${branch}/dir/file0.ext`,
newContent: 'a', newContent: 'a',
}, { }, {
id: 1, id: 1,
changed: true, changed: true,
url: `${branch}/url1`, url: `/namespace/${projectUrl}/blob/${branch}/dir/file1.ext`,
newContent: 'b', newContent: 'b',
}, { }, {
id: 2, id: 2,
url: `/namespace/${projectUrl}/blob/${branch}/dir/file2.ext`,
changed: false, changed: false,
}]; }];
RepoStore.projectUrl = projectUrl;
function createComponent() { function createComponent() {
const RepoCommitSection = Vue.extend(repoCommitSection); const RepoCommitSection = Vue.extend(repoCommitSection);
......
...@@ -30,7 +30,6 @@ describe('RepoFileButtons', () => { ...@@ -30,7 +30,6 @@ describe('RepoFileButtons', () => {
const history = vm.$el.querySelector('.history'); const history = vm.$el.querySelector('.history');
expect(vm.$el.id).toEqual('repo-file-buttons'); 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.href).toMatch(`/${activeFile.raw_path}`);
expect(raw.textContent).toEqual('Raw'); expect(raw.textContent).toEqual('Raw');
expect(blame.href).toMatch(`/${activeFile.blame_path}`); expect(blame.href).toMatch(`/${activeFile.blame_path}`);
...@@ -41,20 +40,6 @@ describe('RepoFileButtons', () => { ...@@ -41,20 +40,6 @@ describe('RepoFileButtons', () => {
expect(vm.$el.querySelector('.preview').textContent).toEqual(activeFileLabel); 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', () => { it('triggers rawPreviewToggle on preview click', () => {
const activeFile = { const activeFile = {
extension: 'md', 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