Merge branch '44846-improve-web-ide-left-panel-and-modes' into ide-sidebar-commit-box

This commit is contained in:
Phil Hughes 2018-05-04 14:01:16 +01:00
commit f0ffc19ee7
No known key found for this signature in database
GPG Key ID: 32245528C52E0F9F
2 changed files with 30 additions and 36 deletions

View File

@ -1,9 +1,5 @@
<<<<<<< HEAD
import { activityBarViews } from '../constants';
=======
import { __ } from '~/locale';
import { getChangesCountForFiles, filePathMatches } from './utils';
>>>>>>> master
import { activityBarViews } from '../constants';
export const activeFile = state => state.openFiles.find(file => file.active) || null;

View File

@ -73,38 +73,7 @@ describe('RepoFile', () => {
expect(treeChangesEl).not.toBeNull();
expect(treeChangesEl.textContent).toContain('1');
});
});
describe('locked file', () => {
let f;
beforeEach(() => {
f = file('locked file');
f.file_lock = {
user: {
name: 'testuser',
updated_at: new Date(),
},
};
createComponent({
file: f,
level: 0,
});
});
it('renders lock icon', () => {
expect(vm.$el.querySelector('.file-status-icon')).not.toBeNull();
});
it('renders a tooltip', () => {
expect(
vm.$el.querySelector('.ide-file-name span:nth-child(2)').dataset.originalTitle,
).toContain('Locked by testuser');
});
});
describe('folder', () => {
it('renders action dropdown', done => {
createComponent({
file: {
@ -142,4 +111,33 @@ describe('RepoFile', () => {
});
});
});
describe('locked file', () => {
let f;
beforeEach(() => {
f = file('locked file');
f.file_lock = {
user: {
name: 'testuser',
updated_at: new Date(),
},
};
createComponent({
file: f,
level: 0,
});
});
it('renders lock icon', () => {
expect(vm.$el.querySelector('.file-status-icon')).not.toBeNull();
});
it('renders a tooltip', () => {
expect(
vm.$el.querySelector('.ide-file-name span:nth-child(2)').dataset.originalTitle,
).toContain('Locked by testuser');
});
});
});