[ACA-1439] Resolve multi-select issues (#392)

* toolbar enhancements

* code cleanup
This commit is contained in:
Denys Vuika
2018-06-08 21:07:43 +01:00
committed by GitHub
parent f73f99ccf2
commit e33ddb38fd
5 changed files with 31 additions and 32 deletions

View File

@@ -74,31 +74,31 @@ describe('PageComponent', () => {
});
});
describe('firstSelectedDocument', () => {
describe('selectedFile', () => {
it('returns true if selected node is file', () => {
const selection = [ { entry: { isFile: true } } ];
component.setSelection(selection);
expect(component.firstSelectedDocument).toBe(selection[0]);
expect(component.selectedFile).toBe(selection[0]);
});
it('returns false if selected node is folder', () => {
const selection = [ { entry: { isFile: false, isFolder: true } } ];
component.setSelection(selection);
expect(component.firstSelectedDocument).toBeFalsy();
expect(component.selectedFile).toBeFalsy();
});
});
describe('firstSelectedFolder', () => {
describe('selectedFolder', () => {
it('returns true if selected node is folder', () => {
const selection = [ { entry: { isFile: false, isFolder: true } } ];
component.setSelection(selection);
expect(component.firstSelectedFolder).toBe(selection[0]);
expect(component.selectedFolder).toBe(selection[0]);
});
it('returns false if selected node is file', () => {
const selection = [ { entry: { isFile: true, isFolder: false } } ];
component.setSelection(selection);
expect(component.firstSelectedFolder).toBeFalsy();
expect(component.selectedFolder).toBeFalsy();
});
});
});