Merge branch '44846-improve-web-ide-left-panel-and-modes' into ide-sidebar-commit-box
This commit is contained in:
commit
f0ffc19ee7
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue